opencl_ruby_ffi 0.5 → 0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,6 +16,9 @@ module OpenCL
16
16
  def s0=(value)
17
17
  self[:s0] = value
18
18
  end
19
+ def to_s
20
+ return "Char{ #{self[:s0]} }"
21
+ end
19
22
  end
20
23
  # Maps the cl_uchar type of OpenCL
21
24
  class UChar < FFI::Struct
@@ -34,6 +37,9 @@ module OpenCL
34
37
  def s0=(value)
35
38
  self[:s0] = value
36
39
  end
40
+ def to_s
41
+ return "UChar{ #{self[:s0]} }"
42
+ end
37
43
  end
38
44
  # Maps the cl_short type of OpenCL
39
45
  class Short < FFI::Struct
@@ -52,6 +58,9 @@ module OpenCL
52
58
  def s0=(value)
53
59
  self[:s0] = value
54
60
  end
61
+ def to_s
62
+ return "Short{ #{self[:s0]} }"
63
+ end
55
64
  end
56
65
  # Maps the cl_ushort type of OpenCL
57
66
  class UShort < FFI::Struct
@@ -70,6 +79,9 @@ module OpenCL
70
79
  def s0=(value)
71
80
  self[:s0] = value
72
81
  end
82
+ def to_s
83
+ return "UShort{ #{self[:s0]} }"
84
+ end
73
85
  end
74
86
  # Maps the cl_int type of OpenCL
75
87
  class Int < FFI::Struct
@@ -88,6 +100,9 @@ module OpenCL
88
100
  def s0=(value)
89
101
  self[:s0] = value
90
102
  end
103
+ def to_s
104
+ return "Int{ #{self[:s0]} }"
105
+ end
91
106
  end
92
107
  # Maps the cl_uint type of OpenCL
93
108
  class UInt < FFI::Struct
@@ -106,6 +121,9 @@ module OpenCL
106
121
  def s0=(value)
107
122
  self[:s0] = value
108
123
  end
124
+ def to_s
125
+ return "UInt{ #{self[:s0]} }"
126
+ end
109
127
  end
110
128
  # Maps the cl_long type of OpenCL
111
129
  class Long < FFI::Struct
@@ -124,6 +142,9 @@ module OpenCL
124
142
  def s0=(value)
125
143
  self[:s0] = value
126
144
  end
145
+ def to_s
146
+ return "Long{ #{self[:s0]} }"
147
+ end
127
148
  end
128
149
  # Maps the cl_ulong type of OpenCL
129
150
  class ULong < FFI::Struct
@@ -142,6 +163,9 @@ module OpenCL
142
163
  def s0=(value)
143
164
  self[:s0] = value
144
165
  end
166
+ def to_s
167
+ return "ULong{ #{self[:s0]} }"
168
+ end
145
169
  end
146
170
  # Maps the cl_float type of OpenCL
147
171
  class Float < FFI::Struct
@@ -160,6 +184,9 @@ module OpenCL
160
184
  def s0=(value)
161
185
  self[:s0] = value
162
186
  end
187
+ def to_s
188
+ return "Float{ #{self[:s0]} }"
189
+ end
163
190
  end
164
191
  # Maps the cl_double type of OpenCL
165
192
  class Double < FFI::Struct
@@ -178,6 +205,9 @@ module OpenCL
178
205
  def s0=(value)
179
206
  self[:s0] = value
180
207
  end
208
+ def to_s
209
+ return "Double{ #{self[:s0]} }"
210
+ end
181
211
  end
182
212
  # Maps the cl_half type of OpenCL
183
213
  class Half < FFI::Struct
@@ -196,6 +226,9 @@ module OpenCL
196
226
  def s0=(value)
197
227
  self[:s0] = value
198
228
  end
229
+ def to_s
230
+ return "Half{ #{self[:s0]} }"
231
+ end
199
232
  end
200
233
  # Maps the cl_char2 type of OpenCL
201
234
  class Char2 < FFI::Struct
@@ -223,6 +256,9 @@ module OpenCL
223
256
  def s1=(value)
224
257
  self[:s1] = value
225
258
  end
259
+ def to_s
260
+ return "Char2{ #{self[:s0]}, #{self[:s1]} }"
261
+ end
226
262
  end
227
263
  # Maps the cl_uchar2 type of OpenCL
228
264
  class UChar2 < FFI::Struct
@@ -250,6 +286,9 @@ module OpenCL
250
286
  def s1=(value)
251
287
  self[:s1] = value
252
288
  end
289
+ def to_s
290
+ return "UChar2{ #{self[:s0]}, #{self[:s1]} }"
291
+ end
253
292
  end
254
293
  # Maps the cl_short2 type of OpenCL
255
294
  class Short2 < FFI::Struct
@@ -277,6 +316,9 @@ module OpenCL
277
316
  def s1=(value)
278
317
  self[:s1] = value
279
318
  end
319
+ def to_s
320
+ return "Short2{ #{self[:s0]}, #{self[:s1]} }"
321
+ end
280
322
  end
281
323
  # Maps the cl_ushort2 type of OpenCL
282
324
  class UShort2 < FFI::Struct
@@ -304,6 +346,9 @@ module OpenCL
304
346
  def s1=(value)
305
347
  self[:s1] = value
306
348
  end
349
+ def to_s
350
+ return "UShort2{ #{self[:s0]}, #{self[:s1]} }"
351
+ end
307
352
  end
308
353
  # Maps the cl_int2 type of OpenCL
309
354
  class Int2 < FFI::Struct
@@ -331,6 +376,9 @@ module OpenCL
331
376
  def s1=(value)
332
377
  self[:s1] = value
333
378
  end
379
+ def to_s
380
+ return "Int2{ #{self[:s0]}, #{self[:s1]} }"
381
+ end
334
382
  end
335
383
  # Maps the cl_uint2 type of OpenCL
336
384
  class UInt2 < FFI::Struct
@@ -358,6 +406,9 @@ module OpenCL
358
406
  def s1=(value)
359
407
  self[:s1] = value
360
408
  end
409
+ def to_s
410
+ return "UInt2{ #{self[:s0]}, #{self[:s1]} }"
411
+ end
361
412
  end
362
413
  # Maps the cl_long2 type of OpenCL
363
414
  class Long2 < FFI::Struct
@@ -385,6 +436,9 @@ module OpenCL
385
436
  def s1=(value)
386
437
  self[:s1] = value
387
438
  end
439
+ def to_s
440
+ return "Long2{ #{self[:s0]}, #{self[:s1]} }"
441
+ end
388
442
  end
389
443
  # Maps the cl_ulong2 type of OpenCL
390
444
  class ULong2 < FFI::Struct
@@ -412,6 +466,9 @@ module OpenCL
412
466
  def s1=(value)
413
467
  self[:s1] = value
414
468
  end
469
+ def to_s
470
+ return "ULong2{ #{self[:s0]}, #{self[:s1]} }"
471
+ end
415
472
  end
416
473
  # Maps the cl_float2 type of OpenCL
417
474
  class Float2 < FFI::Struct
@@ -439,6 +496,9 @@ module OpenCL
439
496
  def s1=(value)
440
497
  self[:s1] = value
441
498
  end
499
+ def to_s
500
+ return "Float2{ #{self[:s0]}, #{self[:s1]} }"
501
+ end
442
502
  end
443
503
  # Maps the cl_double2 type of OpenCL
444
504
  class Double2 < FFI::Struct
@@ -466,6 +526,9 @@ module OpenCL
466
526
  def s1=(value)
467
527
  self[:s1] = value
468
528
  end
529
+ def to_s
530
+ return "Double2{ #{self[:s0]}, #{self[:s1]} }"
531
+ end
469
532
  end
470
533
  # Maps the cl_half2 type of OpenCL
471
534
  class Half2 < FFI::Struct
@@ -493,6 +556,9 @@ module OpenCL
493
556
  def s1=(value)
494
557
  self[:s1] = value
495
558
  end
559
+ def to_s
560
+ return "Half2{ #{self[:s0]}, #{self[:s1]} }"
561
+ end
496
562
  end
497
563
  # Maps the cl_char4 type of OpenCL
498
564
  class Char4 < FFI::Struct
@@ -538,6 +604,9 @@ module OpenCL
538
604
  def s3=(value)
539
605
  self[:s3] = value
540
606
  end
607
+ def to_s
608
+ return "Char4{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]} }"
609
+ end
541
610
  end
542
611
  # Maps the cl_uchar4 type of OpenCL
543
612
  class UChar4 < FFI::Struct
@@ -583,6 +652,9 @@ module OpenCL
583
652
  def s3=(value)
584
653
  self[:s3] = value
585
654
  end
655
+ def to_s
656
+ return "UChar4{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]} }"
657
+ end
586
658
  end
587
659
  # Maps the cl_short4 type of OpenCL
588
660
  class Short4 < FFI::Struct
@@ -628,6 +700,9 @@ module OpenCL
628
700
  def s3=(value)
629
701
  self[:s3] = value
630
702
  end
703
+ def to_s
704
+ return "Short4{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]} }"
705
+ end
631
706
  end
632
707
  # Maps the cl_ushort4 type of OpenCL
633
708
  class UShort4 < FFI::Struct
@@ -673,6 +748,9 @@ module OpenCL
673
748
  def s3=(value)
674
749
  self[:s3] = value
675
750
  end
751
+ def to_s
752
+ return "UShort4{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]} }"
753
+ end
676
754
  end
677
755
  # Maps the cl_int4 type of OpenCL
678
756
  class Int4 < FFI::Struct
@@ -718,6 +796,9 @@ module OpenCL
718
796
  def s3=(value)
719
797
  self[:s3] = value
720
798
  end
799
+ def to_s
800
+ return "Int4{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]} }"
801
+ end
721
802
  end
722
803
  # Maps the cl_uint4 type of OpenCL
723
804
  class UInt4 < FFI::Struct
@@ -763,6 +844,9 @@ module OpenCL
763
844
  def s3=(value)
764
845
  self[:s3] = value
765
846
  end
847
+ def to_s
848
+ return "UInt4{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]} }"
849
+ end
766
850
  end
767
851
  # Maps the cl_long4 type of OpenCL
768
852
  class Long4 < FFI::Struct
@@ -808,6 +892,9 @@ module OpenCL
808
892
  def s3=(value)
809
893
  self[:s3] = value
810
894
  end
895
+ def to_s
896
+ return "Long4{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]} }"
897
+ end
811
898
  end
812
899
  # Maps the cl_ulong4 type of OpenCL
813
900
  class ULong4 < FFI::Struct
@@ -853,6 +940,9 @@ module OpenCL
853
940
  def s3=(value)
854
941
  self[:s3] = value
855
942
  end
943
+ def to_s
944
+ return "ULong4{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]} }"
945
+ end
856
946
  end
857
947
  # Maps the cl_float4 type of OpenCL
858
948
  class Float4 < FFI::Struct
@@ -898,6 +988,9 @@ module OpenCL
898
988
  def s3=(value)
899
989
  self[:s3] = value
900
990
  end
991
+ def to_s
992
+ return "Float4{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]} }"
993
+ end
901
994
  end
902
995
  # Maps the cl_double4 type of OpenCL
903
996
  class Double4 < FFI::Struct
@@ -943,6 +1036,9 @@ module OpenCL
943
1036
  def s3=(value)
944
1037
  self[:s3] = value
945
1038
  end
1039
+ def to_s
1040
+ return "Double4{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]} }"
1041
+ end
946
1042
  end
947
1043
  # Maps the cl_half4 type of OpenCL
948
1044
  class Half4 < FFI::Struct
@@ -988,6 +1084,9 @@ module OpenCL
988
1084
  def s3=(value)
989
1085
  self[:s3] = value
990
1086
  end
1087
+ def to_s
1088
+ return "Half4{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]} }"
1089
+ end
991
1090
  end
992
1091
  # Maps the cl_char8 type of OpenCL
993
1092
  class Char8 < FFI::Struct
@@ -1069,6 +1168,9 @@ module OpenCL
1069
1168
  def s7=(value)
1070
1169
  self[:s7] = value
1071
1170
  end
1171
+ def to_s
1172
+ return "Char8{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]}, #{self[:s4]}, #{self[:s5]}, #{self[:s6]}, #{self[:s7]} }"
1173
+ end
1072
1174
  end
1073
1175
  # Maps the cl_uchar8 type of OpenCL
1074
1176
  class UChar8 < FFI::Struct
@@ -1150,6 +1252,9 @@ module OpenCL
1150
1252
  def s7=(value)
1151
1253
  self[:s7] = value
1152
1254
  end
1255
+ def to_s
1256
+ return "UChar8{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]}, #{self[:s4]}, #{self[:s5]}, #{self[:s6]}, #{self[:s7]} }"
1257
+ end
1153
1258
  end
1154
1259
  # Maps the cl_short8 type of OpenCL
1155
1260
  class Short8 < FFI::Struct
@@ -1231,6 +1336,9 @@ module OpenCL
1231
1336
  def s7=(value)
1232
1337
  self[:s7] = value
1233
1338
  end
1339
+ def to_s
1340
+ return "Short8{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]}, #{self[:s4]}, #{self[:s5]}, #{self[:s6]}, #{self[:s7]} }"
1341
+ end
1234
1342
  end
1235
1343
  # Maps the cl_ushort8 type of OpenCL
1236
1344
  class UShort8 < FFI::Struct
@@ -1312,6 +1420,9 @@ module OpenCL
1312
1420
  def s7=(value)
1313
1421
  self[:s7] = value
1314
1422
  end
1423
+ def to_s
1424
+ return "UShort8{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]}, #{self[:s4]}, #{self[:s5]}, #{self[:s6]}, #{self[:s7]} }"
1425
+ end
1315
1426
  end
1316
1427
  # Maps the cl_int8 type of OpenCL
1317
1428
  class Int8 < FFI::Struct
@@ -1393,6 +1504,9 @@ module OpenCL
1393
1504
  def s7=(value)
1394
1505
  self[:s7] = value
1395
1506
  end
1507
+ def to_s
1508
+ return "Int8{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]}, #{self[:s4]}, #{self[:s5]}, #{self[:s6]}, #{self[:s7]} }"
1509
+ end
1396
1510
  end
1397
1511
  # Maps the cl_uint8 type of OpenCL
1398
1512
  class UInt8 < FFI::Struct
@@ -1474,6 +1588,9 @@ module OpenCL
1474
1588
  def s7=(value)
1475
1589
  self[:s7] = value
1476
1590
  end
1591
+ def to_s
1592
+ return "UInt8{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]}, #{self[:s4]}, #{self[:s5]}, #{self[:s6]}, #{self[:s7]} }"
1593
+ end
1477
1594
  end
1478
1595
  # Maps the cl_long8 type of OpenCL
1479
1596
  class Long8 < FFI::Struct
@@ -1555,6 +1672,9 @@ module OpenCL
1555
1672
  def s7=(value)
1556
1673
  self[:s7] = value
1557
1674
  end
1675
+ def to_s
1676
+ return "Long8{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]}, #{self[:s4]}, #{self[:s5]}, #{self[:s6]}, #{self[:s7]} }"
1677
+ end
1558
1678
  end
1559
1679
  # Maps the cl_ulong8 type of OpenCL
1560
1680
  class ULong8 < FFI::Struct
@@ -1636,6 +1756,9 @@ module OpenCL
1636
1756
  def s7=(value)
1637
1757
  self[:s7] = value
1638
1758
  end
1759
+ def to_s
1760
+ return "ULong8{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]}, #{self[:s4]}, #{self[:s5]}, #{self[:s6]}, #{self[:s7]} }"
1761
+ end
1639
1762
  end
1640
1763
  # Maps the cl_float8 type of OpenCL
1641
1764
  class Float8 < FFI::Struct
@@ -1717,6 +1840,9 @@ module OpenCL
1717
1840
  def s7=(value)
1718
1841
  self[:s7] = value
1719
1842
  end
1843
+ def to_s
1844
+ return "Float8{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]}, #{self[:s4]}, #{self[:s5]}, #{self[:s6]}, #{self[:s7]} }"
1845
+ end
1720
1846
  end
1721
1847
  # Maps the cl_double8 type of OpenCL
1722
1848
  class Double8 < FFI::Struct
@@ -1798,6 +1924,9 @@ module OpenCL
1798
1924
  def s7=(value)
1799
1925
  self[:s7] = value
1800
1926
  end
1927
+ def to_s
1928
+ return "Double8{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]}, #{self[:s4]}, #{self[:s5]}, #{self[:s6]}, #{self[:s7]} }"
1929
+ end
1801
1930
  end
1802
1931
  # Maps the cl_half8 type of OpenCL
1803
1932
  class Half8 < FFI::Struct
@@ -1879,6 +2008,9 @@ module OpenCL
1879
2008
  def s7=(value)
1880
2009
  self[:s7] = value
1881
2010
  end
2011
+ def to_s
2012
+ return "Half8{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]}, #{self[:s4]}, #{self[:s5]}, #{self[:s6]}, #{self[:s7]} }"
2013
+ end
1882
2014
  end
1883
2015
  # Maps the cl_char16 type of OpenCL
1884
2016
  class Char16 < FFI::Struct
@@ -2032,6 +2164,9 @@ module OpenCL
2032
2164
  def sf=(value)
2033
2165
  self[:sf] = value
2034
2166
  end
2167
+ def to_s
2168
+ return "Char16{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]}, #{self[:s4]}, #{self[:s5]}, #{self[:s6]}, #{self[:s7]}, #{self[:s8]}, #{self[:s9]}, #{self[:sa]}, #{self[:sb]}, #{self[:sc]}, #{self[:sd]}, #{self[:se]}, #{self[:sf]} }"
2169
+ end
2035
2170
  end
2036
2171
  # Maps the cl_uchar16 type of OpenCL
2037
2172
  class UChar16 < FFI::Struct
@@ -2185,6 +2320,9 @@ module OpenCL
2185
2320
  def sf=(value)
2186
2321
  self[:sf] = value
2187
2322
  end
2323
+ def to_s
2324
+ return "UChar16{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]}, #{self[:s4]}, #{self[:s5]}, #{self[:s6]}, #{self[:s7]}, #{self[:s8]}, #{self[:s9]}, #{self[:sa]}, #{self[:sb]}, #{self[:sc]}, #{self[:sd]}, #{self[:se]}, #{self[:sf]} }"
2325
+ end
2188
2326
  end
2189
2327
  # Maps the cl_short16 type of OpenCL
2190
2328
  class Short16 < FFI::Struct
@@ -2338,6 +2476,9 @@ module OpenCL
2338
2476
  def sf=(value)
2339
2477
  self[:sf] = value
2340
2478
  end
2479
+ def to_s
2480
+ return "Short16{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]}, #{self[:s4]}, #{self[:s5]}, #{self[:s6]}, #{self[:s7]}, #{self[:s8]}, #{self[:s9]}, #{self[:sa]}, #{self[:sb]}, #{self[:sc]}, #{self[:sd]}, #{self[:se]}, #{self[:sf]} }"
2481
+ end
2341
2482
  end
2342
2483
  # Maps the cl_ushort16 type of OpenCL
2343
2484
  class UShort16 < FFI::Struct
@@ -2491,6 +2632,9 @@ module OpenCL
2491
2632
  def sf=(value)
2492
2633
  self[:sf] = value
2493
2634
  end
2635
+ def to_s
2636
+ return "UShort16{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]}, #{self[:s4]}, #{self[:s5]}, #{self[:s6]}, #{self[:s7]}, #{self[:s8]}, #{self[:s9]}, #{self[:sa]}, #{self[:sb]}, #{self[:sc]}, #{self[:sd]}, #{self[:se]}, #{self[:sf]} }"
2637
+ end
2494
2638
  end
2495
2639
  # Maps the cl_int16 type of OpenCL
2496
2640
  class Int16 < FFI::Struct
@@ -2644,6 +2788,9 @@ module OpenCL
2644
2788
  def sf=(value)
2645
2789
  self[:sf] = value
2646
2790
  end
2791
+ def to_s
2792
+ return "Int16{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]}, #{self[:s4]}, #{self[:s5]}, #{self[:s6]}, #{self[:s7]}, #{self[:s8]}, #{self[:s9]}, #{self[:sa]}, #{self[:sb]}, #{self[:sc]}, #{self[:sd]}, #{self[:se]}, #{self[:sf]} }"
2793
+ end
2647
2794
  end
2648
2795
  # Maps the cl_uint16 type of OpenCL
2649
2796
  class UInt16 < FFI::Struct
@@ -2797,6 +2944,9 @@ module OpenCL
2797
2944
  def sf=(value)
2798
2945
  self[:sf] = value
2799
2946
  end
2947
+ def to_s
2948
+ return "UInt16{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]}, #{self[:s4]}, #{self[:s5]}, #{self[:s6]}, #{self[:s7]}, #{self[:s8]}, #{self[:s9]}, #{self[:sa]}, #{self[:sb]}, #{self[:sc]}, #{self[:sd]}, #{self[:se]}, #{self[:sf]} }"
2949
+ end
2800
2950
  end
2801
2951
  # Maps the cl_long16 type of OpenCL
2802
2952
  class Long16 < FFI::Struct
@@ -2950,6 +3100,9 @@ module OpenCL
2950
3100
  def sf=(value)
2951
3101
  self[:sf] = value
2952
3102
  end
3103
+ def to_s
3104
+ return "Long16{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]}, #{self[:s4]}, #{self[:s5]}, #{self[:s6]}, #{self[:s7]}, #{self[:s8]}, #{self[:s9]}, #{self[:sa]}, #{self[:sb]}, #{self[:sc]}, #{self[:sd]}, #{self[:se]}, #{self[:sf]} }"
3105
+ end
2953
3106
  end
2954
3107
  # Maps the cl_ulong16 type of OpenCL
2955
3108
  class ULong16 < FFI::Struct
@@ -3103,6 +3256,9 @@ module OpenCL
3103
3256
  def sf=(value)
3104
3257
  self[:sf] = value
3105
3258
  end
3259
+ def to_s
3260
+ return "ULong16{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]}, #{self[:s4]}, #{self[:s5]}, #{self[:s6]}, #{self[:s7]}, #{self[:s8]}, #{self[:s9]}, #{self[:sa]}, #{self[:sb]}, #{self[:sc]}, #{self[:sd]}, #{self[:se]}, #{self[:sf]} }"
3261
+ end
3106
3262
  end
3107
3263
  # Maps the cl_float16 type of OpenCL
3108
3264
  class Float16 < FFI::Struct
@@ -3256,6 +3412,9 @@ module OpenCL
3256
3412
  def sf=(value)
3257
3413
  self[:sf] = value
3258
3414
  end
3415
+ def to_s
3416
+ return "Float16{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]}, #{self[:s4]}, #{self[:s5]}, #{self[:s6]}, #{self[:s7]}, #{self[:s8]}, #{self[:s9]}, #{self[:sa]}, #{self[:sb]}, #{self[:sc]}, #{self[:sd]}, #{self[:se]}, #{self[:sf]} }"
3417
+ end
3259
3418
  end
3260
3419
  # Maps the cl_double16 type of OpenCL
3261
3420
  class Double16 < FFI::Struct
@@ -3409,6 +3568,9 @@ module OpenCL
3409
3568
  def sf=(value)
3410
3569
  self[:sf] = value
3411
3570
  end
3571
+ def to_s
3572
+ return "Double16{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]}, #{self[:s4]}, #{self[:s5]}, #{self[:s6]}, #{self[:s7]}, #{self[:s8]}, #{self[:s9]}, #{self[:sa]}, #{self[:sb]}, #{self[:sc]}, #{self[:sd]}, #{self[:se]}, #{self[:sf]} }"
3573
+ end
3412
3574
  end
3413
3575
  # Maps the cl_half16 type of OpenCL
3414
3576
  class Half16 < FFI::Struct
@@ -3562,5 +3724,8 @@ module OpenCL
3562
3724
  def sf=(value)
3563
3725
  self[:sf] = value
3564
3726
  end
3727
+ def to_s
3728
+ return "Half16{ #{self[:s0]}, #{self[:s1]}, #{self[:s2]}, #{self[:s3]}, #{self[:s4]}, #{self[:s5]}, #{self[:s6]}, #{self[:s7]}, #{self[:s8]}, #{self[:s9]}, #{self[:sa]}, #{self[:sb]}, #{self[:sc]}, #{self[:sd]}, #{self[:se]}, #{self[:sf]} }"
3729
+ end
3565
3730
  end
3566
3731
  end
@@ -18,7 +18,7 @@ module OpenCL
18
18
  error = FFI::MemoryPointer.new( :cl_int )
19
19
  buff = OpenCL.clCreateBuffer(context, flags, size, host_ptr, error)
20
20
  OpenCL.error_check(error.read_cl_int)
21
- return Buffer::new( buff, false )
21
+ return OpenCL::Buffer::new( buff, false )
22
22
  end
23
23
 
24
24
  # Creates a Buffer from a sub part of an existing Buffer
@@ -39,7 +39,7 @@ module OpenCL
39
39
  error = FFI::MemoryPointer::new( :cl_int )
40
40
  buff = OpenCL.clCreateSubBuffer( buffer, flags, type, info, error)
41
41
  OpenCL.error_check(error.read_cl_int)
42
- return Buffer::new( buff, false )
42
+ return OpenCL::Buffer::new( buff, false )
43
43
  end
44
44
 
45
45
  # Creates Buffer from an opengl buffer
@@ -58,7 +58,7 @@ module OpenCL
58
58
  error = FFI::MemoryPointer::new( :cl_int )
59
59
  buff = OpenCL.clCreateFromGLBuffer( context, flags, bufobj, error )
60
60
  OpenCL.error_check(error.read_cl_int)
61
- return Buffer::new( buff, false )
61
+ return OpenCL::Buffer::new( buff, false )
62
62
  end
63
63
 
64
64
  # Maps the cl_mem OpenCL object of type CL_MEM_OBJECT_BUFFER
@@ -38,7 +38,7 @@ module OpenCL
38
38
  error = FFI::MemoryPointer::new( :cl_int )
39
39
  cmd = OpenCL.clCreateCommandQueue( context, device, properties, error )
40
40
  OpenCL.error_check(error.read_cl_int)
41
- return CommandQueue::new(cmd, false)
41
+ return OpenCL::CommandQueue::new(cmd, false)
42
42
  end
43
43
 
44
44
  # Enqueues a command to indicate which device a set of memory objects should be migrated to
@@ -69,7 +69,7 @@ module OpenCL
69
69
  end
70
70
  flags = OpenCL.get_flags( options )
71
71
  num_events, events = OpenCL.get_event_wait_list( options )
72
- event = FFI::MemoryPointer::new( Event )
72
+ event = FFI::MemoryPointer::new( OpenCL::Event )
73
73
  error = OpenCL.clEnqueueMigrateMemObjects( command_queue, num_mem_objects, mem_list, flags, num_events, events, event )
74
74
  OpenCL.error_check( error )
75
75
  return OpenCL::Event::new( event.read_ptr, false )
@@ -108,7 +108,7 @@ module OpenCL
108
108
  num_events, events = OpenCL.get_event_wait_list( options )
109
109
  image_row_pitch = FFI::MemoryPointer::new( :size_t )
110
110
  image_slice_pitch = FFI::MemoryPointer::new( :size_t )
111
- event = FFI::MemoryPointer::new( Event )
111
+ event = FFI::MemoryPointer::new( OpenCL::Event )
112
112
  error = FFI::MemoryPointer::new( :cl_int )
113
113
  OpenCL.clEnqueueMapImage( command_queue, image, blocking, map_flags, origin, region, image_row_pitch, image_slice_pitch, num_events, events, event, error )
114
114
  OpenCL.error_check( error.read_cl_int )
@@ -146,7 +146,7 @@ module OpenCL
146
146
  size = buffer.size - offset
147
147
  size = options[:size] - offset if options[:size]
148
148
  num_events, events = OpenCL.get_event_wait_list( options )
149
- event = FFI::MemoryPointer::new( Event )
149
+ event = FFI::MemoryPointer::new( OpenCL::Event )
150
150
  error = FFI::MemoryPointer::new( :cl_int )
151
151
  ptr = OpenCL.clEnqueueMapBuffer( command_queue, buffer, blocking, map_flags, offset, size, num_events, events, error )
152
152
  OpenCL.error_check( error.read_cl_int )
@@ -172,7 +172,7 @@ module OpenCL
172
172
  # the Event associated with the command
173
173
  def self.enqueue_unmap_mem_object( command_queue, mem_obj, mapped_ptr, options = {} )
174
174
  num_events, events = OpenCL.get_event_wait_list( options )
175
- event = FFI::MemoryPointer::new( Event )
175
+ event = FFI::MemoryPointer::new( OpenCL::Event )
176
176
  error = OpenCL.clEnqueueUnmapMemObject( command_queue, mem_obj, mapped_ptr, num_events, events, event )
177
177
  OpenCL.error_check( error )
178
178
  return OpenCL::Event::new( event.read_ptr, false )
@@ -249,7 +249,7 @@ module OpenCL
249
249
  host_slice_pitch = 0
250
250
  end
251
251
  num_events, events = OpenCL.get_event_wait_list( options )
252
- event = FFI::MemoryPointer::new( Event )
252
+ event = FFI::MemoryPointer::new( OpenCL::Event )
253
253
  error = OpenCL.clEnqueueReadBufferRect(command_queue, buffer, blocking, buffer_origin, host_origin, r, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, ptr, num_events, events, event)
254
254
  OpenCL.error_check(error)
255
255
  return OpenCL::Event::new(event.read_pointer, false)
@@ -326,7 +326,7 @@ module OpenCL
326
326
  host_slice_pitch = 0
327
327
  end
328
328
  num_events, events = OpenCL.get_event_wait_list( options )
329
- event = FFI::MemoryPointer::new( Event )
329
+ event = FFI::MemoryPointer::new( OpenCL::Event )
330
330
  error = OpenCL.clEnqueueWriteBufferRect(command_queue, buffer, blocking, buffer_origin, host_origin, r, buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch, ptr, num_events, events, event)
331
331
  OpenCL.error_check(error)
332
332
  return OpenCL::Event::new(event.read_pointer, false)
@@ -397,7 +397,7 @@ module OpenCL
397
397
  dst_slice_pitch = 0
398
398
  end
399
399
  num_events, events = OpenCL.get_event_wait_list( options )
400
- event = FFI::MemoryPointer::new( Event )
400
+ event = FFI::MemoryPointer::new( OpenCL::Event )
401
401
  error = OpenCL.clEnqueueCopyBufferRect(command_queue, src_buffer, dst_buffer, src_origin, dst_origin, r, src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch, num_events, events, event)
402
402
  OpenCL.error_check(error)
403
403
  return OpenCL::Event::new(event.read_pointer, false)
@@ -430,7 +430,7 @@ module OpenCL
430
430
  size = [ src_buffer.size - src_offset, dst_buffer.size - dst_offset ].min
431
431
  size = options[:size] if options[:size]
432
432
  num_events, events = OpenCL.get_event_wait_list( options )
433
- event = FFI::MemoryPointer::new( Event )
433
+ event = FFI::MemoryPointer::new( OpenCL::Event )
434
434
  error = OpenCL.clEnqueueCopyBuffer(command_queue, src_buffer, dst_buffer, src_offset, dst_offset, size, num_events, events, event)
435
435
  OpenCL.error_check(error)
436
436
  return OpenCL::Event::new(event.read_pointer, false)
@@ -465,7 +465,7 @@ module OpenCL
465
465
  size = buffer.size - offset
466
466
  size = options[:size] if options[:size]
467
467
  num_events, events = OpenCL.get_event_wait_list( options )
468
- event = FFI::MemoryPointer::new( Event )
468
+ event = FFI::MemoryPointer::new( OpenCL::Event )
469
469
  error = OpenCL.clEnqueueWriteBuffer(command_queue, buffer, blocking, offset, size, ptr, num_events, events, event)
470
470
  OpenCL.error_check(error)
471
471
  return OpenCL::Event::new(event.read_pointer, false)
@@ -499,7 +499,7 @@ module OpenCL
499
499
  size = buffer.size - offset
500
500
  size = options[:size] if options[:size]
501
501
  num_events, events = OpenCL.get_event_wait_list( options )
502
- event = FFI::MemoryPointer::new( Event )
502
+ event = FFI::MemoryPointer::new( OpenCL::Event )
503
503
  error = OpenCL.clEnqueueReadBuffer(command_queue, buffer, blocking, offset, size, ptr, num_events, events, event)
504
504
  OpenCL.error_check(error)
505
505
  return OpenCL::Event::new(event.read_pointer, false)
@@ -524,13 +524,13 @@ module OpenCL
524
524
  num_objs = [mem_objects].flatten.length
525
525
  objs = nil
526
526
  if num_objs > 0 then
527
- objs = FFI::MemoryPointer::new( Mem, num_objs )
527
+ objs = FFI::MemoryPointer::new( OpenCL::Mem, num_objs )
528
528
  [mem_objects].flatten.each_with_index { |o, i|
529
529
  objs[i].write_pointer(e)
530
530
  }
531
531
  end
532
532
  num_events, events = OpenCL.get_event_wait_list( options )
533
- event = FFI::MemoryPointer::new( Event )
533
+ event = FFI::MemoryPointer::new( OpenCL::Event )
534
534
  error = OpenCL.clEnqueueAcquireGLObject( command_queue, num_objs, objs, num_events, events, event )
535
535
  OpenCL.error_check(error)
536
536
  return OpenCL::Event::new(event.read_pointer, false)
@@ -555,13 +555,13 @@ module OpenCL
555
555
  num_objs = [mem_objects].flatten.length
556
556
  objs = nil
557
557
  if num_objs > 0 then
558
- objs = FFI::MemoryPointer::new( Mem, num_objs )
558
+ objs = FFI::MemoryPointer::new( OpenCL::Mem, num_objs )
559
559
  [mem_objects].flatten.each_with_index { |o, i|
560
560
  objs[i].write_pointer(e)
561
561
  }
562
562
  end
563
563
  num_events, events = OpenCL.get_event_wait_list( options )
564
- event = FFI::MemoryPointer::new( Event )
564
+ event = FFI::MemoryPointer::new( OpenCL::Event )
565
565
  error = OpenCL.clEnqueueReleaseGLObject( command_queue, num_objs, objs, num_events, events, event )
566
566
  OpenCL.error_check(error)
567
567
  return OpenCL::Event::new(event.read_pointer, false)
@@ -595,7 +595,7 @@ module OpenCL
595
595
  size = (buffer.size - offset) % pattern_size
596
596
  size = options[:size] if options[:size]
597
597
  num_events, events = OpenCL.get_event_wait_list( options )
598
- event = FFI::MemoryPointer::new( Event )
598
+ event = FFI::MemoryPointer::new( OpenCL::Event )
599
599
  error = OpenCL.clEnqueueFillBuffer( command_queue, buffer, pattern, pattern_size, offset, size, num_events, events, event )
600
600
  OpenCL.error_check(error)
601
601
  return OpenCL::Event::new(event.read_pointer, false)
@@ -623,7 +623,7 @@ module OpenCL
623
623
  OpenCL.error_check(OpenCL::INVALID_OPERATION) if command_queue.context.platform.version_number < 1.1
624
624
  origin, region = OpenCL.get_origin_region( image, options, :origin, :region )
625
625
  num_events, events = OpenCL.get_event_wait_list( options )
626
- event = FFI::MemoryPointer::new( Event )
626
+ event = FFI::MemoryPointer::new( OpenCL::Event )
627
627
  error = OpenCL.clEnqueueFillImage( command_queue, image, fill_color, origin, region, num_events, events, event )
628
628
  OpenCL.error_check(error)
629
629
  return OpenCL::Event::new(event.read_pointer, false)
@@ -653,7 +653,7 @@ module OpenCL
653
653
  dst_offset = 0
654
654
  dst_offset = options[:dst_offset] if options[:dst_offset]
655
655
  num_events, events = OpenCL.get_event_wait_list( options )
656
- event = FFI::MemoryPointer::new( Event )
656
+ event = FFI::MemoryPointer::new( OpenCL::Event )
657
657
  error = OpenCL.clEnqueueCopyImageToBuffer( command_queue, src_image, dst_buffer, src_origin, region, dst_offset, num_events, events, event )
658
658
  OpenCL.error_check(error)
659
659
  return OpenCL::Event::new(event.read_pointer, false)
@@ -683,7 +683,7 @@ module OpenCL
683
683
  src_offset = 0
684
684
  src_offset = options[:src_offset] if options[:src_offset]
685
685
  num_events, events = OpenCL.get_event_wait_list( options )
686
- event = FFI::MemoryPointer::new( Event )
686
+ event = FFI::MemoryPointer::new( OpenCL::Event )
687
687
  error = OpenCL.clEnqueueCopyBufferToImage( command_queue, src_buffer, dst_image, src_offset, dst_origin, region, num_events, events, event )
688
688
  OpenCL.error_check(error)
689
689
  return OpenCL::Event::new(event.read_pointer, false)
@@ -722,7 +722,7 @@ module OpenCL
722
722
  input_slice_pitch = 0
723
723
  input_slice_pitch = options[:input_slice_pitch] if options[:input_slice_pitch]
724
724
  num_events, events = OpenCL.get_event_wait_list( options )
725
- event = FFI::MemoryPointer::new( Event )
725
+ event = FFI::MemoryPointer::new( OpenCL::Event )
726
726
  error = OpenCL.clEnqueueWriteImage( command_queue, image, blocking, origin, region, input_row_pitch, input_slice_pitch, ptr, num_events, events, event )
727
727
  OpenCL.error_check(error)
728
728
  return OpenCL::Event::new(event.read_pointer, false)
@@ -755,7 +755,7 @@ module OpenCL
755
755
  region[i].write_size_t( [src_region[i].read_size_t, dst_region[i].read_size_t].min )
756
756
  }
757
757
  num_events, events = OpenCL.get_event_wait_list( options )
758
- event = FFI::MemoryPointer::new( Event )
758
+ event = FFI::MemoryPointer::new( OpenCL::Event )
759
759
  error = OpenCL.clEnqueueCopyImage( command_queue, src_image, dst_image, src_origin, dst_origin, region, num_events, events, event )
760
760
  OpenCL.error_check(error)
761
761
  return OpenCL::Event::new(event.read_pointer, false)
@@ -793,7 +793,7 @@ module OpenCL
793
793
  slice_pitch = 0
794
794
  slice_pitch = options[:slice_pitch] if options[:slice_pitch]
795
795
  num_events, events = OpenCL.get_event_wait_list( options )
796
- event = FFI::MemoryPointer::new( Event )
796
+ event = FFI::MemoryPointer::new( OpenCL::Event )
797
797
  error = OpenCL.clEnqueueReadImage( command_queue, image, blocking, origin, region, row_pitch, slice_pitch, ptr, num_events, events, event )
798
798
  OpenCL.error_check(error)
799
799
  return OpenCL::Event::new(event.read_pointer, false)
@@ -837,7 +837,7 @@ module OpenCL
837
837
  num_mem_objects = options[:mem_list].length
838
838
  if num_mem_objects > 0 then
839
839
  mem_list = FFI::MemoryPointer::new( OpenCL::Mem, num_mem_objects )
840
- mem_loc = FFI::MemoryPointer::new( Pointer, num_mem_objects )
840
+ mem_loc = FFI::MemoryPointer::new( :pointer, num_mem_objects )
841
841
  i = 0
842
842
  options[:mem_list].each { |key, value|
843
843
  mem_list[i].write_pointer(key)
@@ -847,7 +847,7 @@ module OpenCL
847
847
  end
848
848
  end
849
849
  num_events, events = OpenCL.get_event_wait_list( options )
850
- event = FFI::MemoryPointer::new( Event )
850
+ event = FFI::MemoryPointer::new( OpenCL::Event )
851
851
  error = OpenCL.clEnqueueNativeKernel( command_queue, func, args, args_size, num_mem_objects, mem_list, mem_loc, num_events, events, event )
852
852
  OpenCL.error_check(error)
853
853
  return OpenCL::Event::new(event.read_pointer, false)
@@ -870,7 +870,7 @@ module OpenCL
870
870
  # the Event associated with the command
871
871
  def self.enqueue_task( command_queue, kernel, options = {} )
872
872
  num_events, events = OpenCL.get_event_wait_list( options )
873
- event = FFI::MemoryPointer::new( Event )
873
+ event = FFI::MemoryPointer::new( OpenCL::Event )
874
874
  error = OpenCL.clEnqueueTask( command_queue, kernel, num_events, events, event )
875
875
  OpenCL.error_check(error)
876
876
  return OpenCL::Event::new(event.read_pointer, false)
@@ -914,7 +914,7 @@ module OpenCL
914
914
  }
915
915
  end
916
916
  num_events, events = OpenCL.get_event_wait_list( options )
917
- event = FFI::MemoryPointer::new( Event )
917
+ event = FFI::MemoryPointer::new( OpenCL::Event )
918
918
  error = OpenCL.clEnqueueNDRangeKernel(command_queue, kernel, global_work_size.length, gwo, gws, lws, num_events, events, event)
919
919
  OpenCL.error_check(error)
920
920
  return OpenCL::Event::new(event.read_pointer, false)
@@ -948,7 +948,7 @@ module OpenCL
948
948
  if command_queue.context.platform.version_number < 1.2 then
949
949
  num_events = [events].flatten.length
950
950
  if num_events > 0 then
951
- evts = FFI::MemoryPointer::new( Event, num_events )
951
+ evts = FFI::MemoryPointer::new( OpenCL::Event, num_events )
952
952
  [events].flatten.each_with_index { |e, i|
953
953
  evts[i].write_pointer(e)
954
954
  }
@@ -962,12 +962,12 @@ module OpenCL
962
962
  num_events = [events].flatten.length
963
963
  evts = nil
964
964
  if num_events > 0 then
965
- evts = FFI::MemoryPointer::new( Event, num_events )
965
+ evts = FFI::MemoryPointer::new( OpenCL::Event, num_events )
966
966
  [events].flatten.each_with_index { |e, i|
967
967
  evts[i].write_pointer(e)
968
968
  }
969
969
  end
970
- event = FFI::MemoryPointer::new( Event )
970
+ event = FFI::MemoryPointer::new( OpenCL::Event )
971
971
  error = OpenCL.clEnqueueBarrierWithWaitList( command_queue, num_events, evts, event )
972
972
  OpenCL.error_check(error)
973
973
  return OpenCL::Event::new(event.read_pointer, false)
@@ -985,14 +985,14 @@ module OpenCL
985
985
  #
986
986
  # an Event
987
987
  def self.enqueue_marker( command_queue, events = [] )
988
- event = FFI::MemoryPointer::new( Event )
988
+ event = FFI::MemoryPointer::new( OpenCL::Event )
989
989
  if command_queue.context.platform.version_number < 1.2 then
990
990
  error = OpenCL.clEnqueueMarker( command_queue, event )
991
991
  else
992
992
  num_events = [events].flatten.length
993
993
  evts = nil
994
994
  if num_events > 0 then
995
- evts = FFI::MemoryPointer::new( Event, num_events )
995
+ evts = FFI::MemoryPointer::new( OpenCL::Event, num_events )
996
996
  [events].flatten.each_with_index { |e, i|
997
997
  evts[i].write_pointer(e)
998
998
  }
@@ -1008,16 +1008,16 @@ module OpenCL
1008
1008
 
1009
1009
  # Returns the Context associated to the CommandQueue
1010
1010
  def context
1011
- ptr = FFI::MemoryPointer::new( Context )
1012
- error = OpenCL.clGetCommandQueueInfo(self, CommandQueue::CONTEXT, Context.size, ptr, nil)
1011
+ ptr = FFI::MemoryPointer::new( OpenCL::Context )
1012
+ error = OpenCL.clGetCommandQueueInfo(self, OpenCL::CommandQueue::CONTEXT, Context.size, ptr, nil)
1013
1013
  OpenCL.error_check(error)
1014
1014
  return OpenCL::Context::new( ptr.read_pointer )
1015
1015
  end
1016
1016
 
1017
1017
  # Returns the Device associated to the CommandQueue
1018
1018
  def device
1019
- ptr = FFI::MemoryPointer::new( Device )
1020
- error = OpenCL.clGetCommandQueueInfo(self, CommandQueue::DEVICE, Device.size, ptr, nil)
1019
+ ptr = FFI::MemoryPointer::new( OpenCL::Device )
1020
+ error = OpenCL.clGetCommandQueueInfo(self, OpenCL::CommandQueue::DEVICE, Device.size, ptr, nil)
1021
1021
  OpenCL.error_check(error)
1022
1022
  return OpenCL::Device::new( ptr.read_pointer )
1023
1023
  end
@@ -72,12 +72,12 @@ module OpenCL
72
72
  def num_devices
73
73
  d_n = 0
74
74
  ptr = FFI::MemoryPointer::new( :size_t )
75
- error = OpenCL.clGetContextInfo(self, Context::DEVICES, 0, nil, ptr)
75
+ error = OpenCL.clGetContextInfo(self, OpenCL::Context::DEVICES, 0, nil, ptr)
76
76
  OpenCL.error_check(error)
77
77
  d_n = ptr.read_size_t / Platform.size
78
78
  # else
79
79
  # ptr = FFI::MemoryPointer::new( :cl_uint )
80
- # error = OpenCL.clGetContextInfo(self, Context::NUM_DEVICES, ptr.size, ptr, nil)
80
+ # error = OpenCL.clGetContextInfo(self, OpenCL::Context::NUM_DEVICES, ptr.size, ptr, nil)
81
81
  # OpenCL.error_check(error)
82
82
  # d_n = ptr.read_cl_uint
83
83
  # end
@@ -88,7 +88,7 @@ module OpenCL
88
88
  def devices
89
89
  n = self.num_devices
90
90
  ptr2 = FFI::MemoryPointer::new( Device, n )
91
- error = OpenCL.clGetContextInfo(self, Context::DEVICES, Device.size*n, ptr2, nil)
91
+ error = OpenCL.clGetContextInfo(self, OpenCL::Context::DEVICES, Device.size*n, ptr2, nil)
92
92
  OpenCL.error_check(error)
93
93
  return ptr2.get_array_of_pointer(0, n).collect { |device_ptr|
94
94
  OpenCL::Device::new(device_ptr)
@@ -141,7 +141,7 @@ module OpenCL
141
141
  # Returns the platform the Device belongs to
142
142
  def platform
143
143
  ptr = FFI::MemoryPointer::new( OpenCL::Platform )
144
- error = OpenCL.clGetDeviceInfo(self, Device::PLATFORM, OpenCL::Platform.size, ptr, nil)
144
+ error = OpenCL.clGetDeviceInfo(self, OpenCL::Device::PLATFORM, OpenCL::Platform.size, ptr, nil)
145
145
  OpenCL.error_check(error)
146
146
  return OpenCL::Platform::new(ptr.read_pointer)
147
147
  end
@@ -149,7 +149,7 @@ module OpenCL
149
149
  # Returns the parent Device if it exists
150
150
  def parent_device
151
151
  ptr = FFI::MemoryPointer::new( OpenCL::Device )
152
- error = OpenCL.clGetDeviceInfo(self, Device::PARENT_DEVICE, OpenCL::Device.size, ptr, nil)
152
+ error = OpenCL.clGetDeviceInfo(self, OpenCL::Device::PARENT_DEVICE, OpenCL::Device.size, ptr, nil)
153
153
  OpenCL.error_check(error)
154
154
  return nil if ptr.null?
155
155
  return OpenCL::Device::new(ptr.read_pointer)
@@ -40,7 +40,7 @@ module OpenCL
40
40
  error = FFI::MemoryPointer::new(:cl_int)
41
41
  event = OpenCL.clCreateUserEvent(context, error)
42
42
  OpenCL.error_check(error.read_cl_int)
43
- return Event::new(event, false)
43
+ return OpenCL::Event::new(event, false)
44
44
  end
45
45
 
46
46
  # Sets the satus of user Event to the given execution status
@@ -61,7 +61,7 @@ module OpenCL
61
61
  error = FFI::MemoryPointer::new(:cl_int)
62
62
  event = OpenCL.clCreateEventFromGLsyncKHR(context, sync, error)
63
63
  OpenCL.error_check(error.read_cl_int)
64
- return Event::new(event, false)
64
+ return OpenCL::Event::new(event, false)
65
65
  end
66
66
 
67
67
  # Maps the cl_event object
@@ -69,8 +69,8 @@ module OpenCL
69
69
 
70
70
  # Returns the CommandQueue associated with the Event, if it exists
71
71
  def command_queue
72
- ptr = FFI::MemoryPointer::new( CommandQueue )
73
- error = OpenCL.clGetEventInfo(self, Event::COMMAND_QUEUE, CommandQueue.size, ptr, nil)
72
+ ptr = FFI::MemoryPointer::new( OpenCL::CommandQueue )
73
+ error = OpenCL.clGetEventInfo(self, OpenCL::Event::COMMAND_QUEUE, OpenCL::CommandQueue.size, ptr, nil)
74
74
  OpenCL.error_check(error)
75
75
  pt = ptr.read_pointer
76
76
  if pt.null? then
@@ -82,8 +82,8 @@ module OpenCL
82
82
 
83
83
  # Returns the Context associated with the Event
84
84
  def context
85
- ptr = FFI::MemoryPointer::new( Context )
86
- error = OpenCL.clGetEventInfo(self, Event::CONTEXT, Context.size, ptr, nil)
85
+ ptr = FFI::MemoryPointer::new( OpenCL::Context )
86
+ error = OpenCL.clGetEventInfo(self, OpenCL::Event::CONTEXT, OpenCL::Context.size, ptr, nil)
87
87
  OpenCL.error_check(error)
88
88
  return OpenCL::Context::new( ptr.read_pointer )
89
89
  end
@@ -18,7 +18,7 @@ module OpenCL
18
18
  error = FFI::MemoryPointer::new( :cl_int )
19
19
  img_ptr = OpenCL.clCreateImage( context, flags, format, desc, host_ptr, error )
20
20
  OpenCL.error_check(error.read_cl_int)
21
- return Image::new(img_ptr, false)
21
+ return OpenCL::Image::new(img_ptr, false)
22
22
  end
23
23
 
24
24
  # Creates a 1D Image
@@ -67,7 +67,7 @@ module OpenCL
67
67
  error = FFI::MemoryPointer::new( :cl_int )
68
68
  img_ptr = OpenCL.clCreateImage2D( context, flags, format, width, heigh, row_pitch, host_ptr, error )
69
69
  OpenCL.error_check(error.read_cl_int)
70
- return Image::new(img_ptr, false)
70
+ return OpenCL::Image::new(img_ptr, false)
71
71
  end
72
72
 
73
73
  # Creates a 3D Image
@@ -98,7 +98,7 @@ module OpenCL
98
98
  error = FFI::MemoryPointer::new( :cl_int )
99
99
  img_ptr = OpenCL.clCreateImage3D( context, fs, format, width, heigh, depth, row_pitch, slice_pitch, d, error )
100
100
  OpenCL.error_check(error.read_cl_int)
101
- return Image::new(img_ptr, false)
101
+ return OpenCL::Image::new(img_ptr, false)
102
102
  end
103
103
 
104
104
  # Creates an Image from an OpenGL render buffer
@@ -117,7 +117,7 @@ module OpenCL
117
117
  error = FFI::MemoryPointer::new( :cl_int )
118
118
  img = OpenCL.clCreateFromGLRenderBuffer( context, flags, renderbuffer, error )
119
119
  OpenCL.error_check(error.read_cl_int)
120
- return Image::new( img, false )
120
+ return OpenCL::Image::new( img, false )
121
121
  end
122
122
 
123
123
  # Creates an Image from an OpenGL texture
@@ -143,7 +143,7 @@ module OpenCL
143
143
  error = FFI::MemoryPointer::new( :cl_int )
144
144
  img = OpenCL.clCreateFromGLTexture( context, flags, texture_target, miplevel, texture, error )
145
145
  OpenCL.error_check(error.read_cl_int)
146
- return Image::new( img, false )
146
+ return OpenCL::Image::new( img, false )
147
147
  end
148
148
 
149
149
  # Creates an Image from an OpenGL 2D texture
@@ -168,7 +168,7 @@ module OpenCL
168
168
  error = FFI::MemoryPointer::new( :cl_int )
169
169
  img = OpenCL.clCreateFromGLTexture2D( context, flags, texture_target, miplevel, texture, error )
170
170
  OpenCL.error_check(error.read_cl_int)
171
- return Image::new( img, false )
171
+ return OpenCL::Image::new( img, false )
172
172
  end
173
173
 
174
174
  # Creates an Image from an OpenGL 3D texture
@@ -193,7 +193,7 @@ module OpenCL
193
193
  error = FFI::MemoryPointer::new( :cl_int )
194
194
  img = OpenCL.clCreateFromGLTexture3D( context, flags, texture_target, miplevel, texture, error )
195
195
  OpenCL.error_check(error.read_cl_int)
196
- return Image::new( img, false )
196
+ return OpenCL::Image::new( img, false )
197
197
  end
198
198
 
199
199
  # Maps the cl_mem OpenCL objects of type CL_MEM_OBJECT_IMAGE*
@@ -244,12 +244,12 @@ module OpenCL
244
244
 
245
245
  # Returns the ImageDesc corresponding to the Image
246
246
  def desc
247
- return ImageDesc::new( self.type, self.width, self.height, self.depth, self.array_size, self.row_pitch, self.slice_pitch, self.num_mip_levels, self.num_samples, self.buffer )
247
+ return OpenCL::ImageDesc::new( self.type, self.width, self.height, self.depth, self.array_size, self.row_pitch, self.slice_pitch, self.num_mip_levels, self.num_samples, self.buffer )
248
248
  end
249
249
 
250
250
  # Returns the ImageFormat corresponding to the image
251
251
  def format
252
- image_format = FFI::MemoryPointer::new( ImageFormat )
252
+ image_format = FFI::MemoryPointer::new( OpenCL::ImageFormat )
253
253
  error = OpenCL.clGetImageInfo( self, OpenCL::Image::FORMAT, image_format.size, image_format, nil)
254
254
  OpenCL.error_check(error)
255
255
  return OpenCL::ImageFormat::from_pointer( image_format )
@@ -144,7 +144,7 @@ module OpenCL
144
144
  # Returns the Context the Kernel is associated with
145
145
  def context
146
146
  ptr = FFI::MemoryPointer::new( Context )
147
- error = OpenCL.clGetKernelInfo(self, Kernel::CONTEXT, Context.size, ptr, nil)
147
+ error = OpenCL.clGetKernelInfo(self, OpenCL::Kernel::CONTEXT, Context.size, ptr, nil)
148
148
  OpenCL.error_check(error)
149
149
  return OpenCL::Context::new( ptr.read_pointer )
150
150
  end
@@ -152,7 +152,7 @@ module OpenCL
152
152
  # Returns the Program the Kernel was created from
153
153
  def program
154
154
  ptr = FFI::MemoryPointer::new( Program )
155
- error = OpenCL.clGetKernelInfo(self, Kernel::PROGRAM, Program.size, ptr, nil)
155
+ error = OpenCL.clGetKernelInfo(self, OpenCL::Kernel::PROGRAM, Program.size, ptr, nil)
156
156
  OpenCL.error_check(error)
157
157
  return OpenCL::Program::new(ptr.read_pointer)
158
158
  end
@@ -24,7 +24,7 @@ module OpenCL
24
24
  # Returns the Context associated to the Mem
25
25
  def context
26
26
  ptr = FFI::MemoryPointer::new( Context )
27
- error = OpenCL.clGetMemObjectInfo(self, Mem::CONTEXT, Context.size, ptr, nil)
27
+ error = OpenCL.clGetMemObjectInfo(self, OpenCL::Mem::CONTEXT, Context.size, ptr, nil)
28
28
  OpenCL.error_check(error)
29
29
  return OpenCL::Context::new( ptr.read_pointer )
30
30
  end
@@ -37,7 +37,7 @@ module OpenCL
37
37
  # Returns the Buffer this Buffer was created from using create_sub_buffer
38
38
  def associated_memobject
39
39
  ptr = FFI::MemoryPointer::new( Mem )
40
- error = OpenCL.clGetMemObjectInfo(self, Mem::ASSOCIATED_MEMOBJECT, Mem.size, ptr, nil)
40
+ error = OpenCL.clGetMemObjectInfo(self, OpenCL::Mem::ASSOCIATED_MEMOBJECT, Mem.size, ptr, nil)
41
41
  OpenCL.error_check(error)
42
42
  return nil if ptr.read_pointer.null?
43
43
  return OpenCL::Mem::new( ptr.read_pointer )
@@ -324,7 +324,7 @@ module OpenCL
324
324
  total_size += s
325
325
  bin_array[i].write_pointer(FFI::MemoryPointer::new(s))
326
326
  }
327
- error = OpenCL.clGetProgramInfo(self, Program::BINARIES, total_size, bin_array, nil)
327
+ error = OpenCL.clGetProgramInfo(self, OpenCL::Program::BINARIES, total_size, bin_array, nil)
328
328
  OpenCL.error_check(error)
329
329
  bins = []
330
330
  devs = self.devices
@@ -369,7 +369,7 @@ module OpenCL
369
369
  # Returns the Context the Program is associated to
370
370
  def context
371
371
  ptr = FFI::MemoryPointer::new( Context )
372
- error = OpenCL.clGetProgramInfo(self, Program::CONTEXT, Context.size, ptr, nil)
372
+ error = OpenCL.clGetProgramInfo(self, OpenCL::Program::CONTEXT, Context.size, ptr, nil)
373
373
  OpenCL.error_check(error)
374
374
  return OpenCL::Context::new( ptr.read_pointer )
375
375
  end
@@ -389,7 +389,7 @@ module OpenCL
389
389
  def devices
390
390
  n = self.num_devices
391
391
  ptr2 = FFI::MemoryPointer::new( Device, n )
392
- error = OpenCL.clGetProgramInfo(self, Program::DEVICES, Device.size*n, ptr2, nil)
392
+ error = OpenCL.clGetProgramInfo(self, OpenCL::Program::DEVICES, Device.size*n, ptr2, nil)
393
393
  OpenCL.error_check(error)
394
394
  return ptr2.get_array_of_pointer(0, n).collect { |device_ptr|
395
395
  OpenCL::Device::new(device_ptr)
@@ -96,7 +96,7 @@ module OpenCL
96
96
 
97
97
  # Returns a new ChannelType corresponding to the ImageFormat internal value
98
98
  def channel_data_type
99
- return OpenCL::convert_type(:cl_channel_type)::new(self[:image_channel_data_type])
99
+ return OpenCL::ChannelType::new(self[:image_channel_data_type])
100
100
  end
101
101
 
102
102
  # Sets the ImageFormat internal value for the image channel data type
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'opencl_ruby_ffi'
3
- s.version = "0.5"
3
+ s.version = "0.6"
4
4
  s.author = "Brice Videau"
5
5
  s.email = "brice.videau@imag.fr"
6
6
  s.homepage = "https://forge.imag.fr/projects/opencl-ruby/"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opencl_ruby_ffi
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.5'
4
+ version: '0.6'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-25 00:00:00.000000000 Z
12
+ date: 2014-03-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: narray