opencl_ruby_ffi 0.994 → 0.995
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/opencl_ruby_ffi/CommandQueue.rb +14 -9
- data/lib/opencl_ruby_ffi/Context.rb +17 -12
- data/lib/opencl_ruby_ffi/Device.rb +29 -24
- data/lib/opencl_ruby_ffi/Event.rb +25 -20
- data/lib/opencl_ruby_ffi/Image.rb +10 -11
- data/lib/opencl_ruby_ffi/Kernel.rb +36 -26
- data/lib/opencl_ruby_ffi/Mem.rb +27 -22
- data/lib/opencl_ruby_ffi/Pipe.rb +6 -1
- data/lib/opencl_ruby_ffi/Platform.rb +14 -9
- data/lib/opencl_ruby_ffi/Program.rb +31 -58
- data/lib/opencl_ruby_ffi/Sampler.rb +11 -6
- data/lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb +186 -154
- data/lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb +110 -96
- data/opencl_ruby_ffi.gemspec +1 -1
- metadata +2 -2
@@ -476,19 +476,23 @@ module OpenCL
|
|
476
476
|
class Error < StandardError
|
477
477
|
attr_reader :code
|
478
478
|
|
479
|
-
def initialize(
|
480
|
-
@code =
|
481
|
-
super("#{
|
479
|
+
def initialize(code)
|
480
|
+
@code = code
|
481
|
+
super("#{code}")
|
482
482
|
end
|
483
483
|
|
484
|
+
#:stopdoc:
|
484
485
|
CLASSES = {}
|
486
|
+
#:startdoc:
|
487
|
+
|
488
|
+
private_constant :CLASSES
|
485
489
|
|
486
490
|
# Returns a string representing the name corresponding to the error code
|
487
|
-
def self.name(
|
488
|
-
if CLASSES[
|
489
|
-
return CLASSES[
|
491
|
+
def self.name(code)
|
492
|
+
if CLASSES[code] then
|
493
|
+
return CLASSES[code].name
|
490
494
|
else
|
491
|
-
return "#{
|
495
|
+
return "#{code}"
|
492
496
|
end
|
493
497
|
end
|
494
498
|
|
@@ -2461,7 +2465,6 @@ module OpenCL
|
|
2461
2465
|
VENDOR = 0x0903
|
2462
2466
|
EXTENSIONS = 0x0904
|
2463
2467
|
ICD_SUFFIX_KHR = 0x0920
|
2464
|
-
#:startdoc:
|
2465
2468
|
|
2466
2469
|
# Creates a new Platform and retains it if specified and aplicable
|
2467
2470
|
def initialize(ptr, retain = true)
|
@@ -2469,6 +2472,11 @@ module OpenCL
|
|
2469
2472
|
#STDERR.puts "Allocating Platform: #{ptr}"
|
2470
2473
|
end
|
2471
2474
|
|
2475
|
+
# method called at Platform deletion, releases the object if aplicable
|
2476
|
+
def self.release(ptr)
|
2477
|
+
end
|
2478
|
+
#:startdoc:
|
2479
|
+
|
2472
2480
|
def to_s
|
2473
2481
|
if self.respond_to?(:name) then
|
2474
2482
|
return self.name
|
@@ -2477,9 +2485,6 @@ module OpenCL
|
|
2477
2485
|
end
|
2478
2486
|
end
|
2479
2487
|
|
2480
|
-
# method called at Platform deletion, releases the object if aplicable
|
2481
|
-
def self.release(ptr)
|
2482
|
-
end
|
2483
2488
|
end
|
2484
2489
|
|
2485
2490
|
class Device < FFI::ManagedStruct
|
@@ -2607,7 +2612,6 @@ module OpenCL
|
|
2607
2612
|
INTEGRATED_MEMORY_NV = 0x4006
|
2608
2613
|
PROFILING_TIMER_OFFSET_AMD = 0x4036
|
2609
2614
|
PAGE_SIZE_QCOM = 0x40A1
|
2610
|
-
#:startdoc:
|
2611
2615
|
|
2612
2616
|
# Creates a new Device and retains it if specified and aplicable
|
2613
2617
|
def initialize(ptr, retain = true)
|
@@ -2617,19 +2621,11 @@ module OpenCL
|
|
2617
2621
|
p = OpenCL::Platform::new(platform.read_pointer)
|
2618
2622
|
if p.version_number >= 1.2 and retain then
|
2619
2623
|
error = OpenCL.clRetainDevice(ptr)
|
2620
|
-
|
2624
|
+
error_check( error )
|
2621
2625
|
end
|
2622
2626
|
#STDERR.puts "Allocating Device: #{ptr}"
|
2623
2627
|
end
|
2624
2628
|
|
2625
|
-
def to_s
|
2626
|
-
if self.respond_to?(:name) then
|
2627
|
-
return self.name
|
2628
|
-
else
|
2629
|
-
return super
|
2630
|
-
end
|
2631
|
-
end
|
2632
|
-
|
2633
2629
|
# method called at Device deletion, releases the object if aplicable
|
2634
2630
|
def self.release(ptr)
|
2635
2631
|
platform = FFI::MemoryPointer::new( Platform )
|
@@ -2637,9 +2633,19 @@ module OpenCL
|
|
2637
2633
|
p = OpenCL::Platform::new(platform.read_pointer)
|
2638
2634
|
if p.version_number >= 1.2 then
|
2639
2635
|
error = OpenCL.clReleaseDevice(ptr)
|
2640
|
-
|
2636
|
+
error_check( error )
|
2637
|
+
end
|
2638
|
+
end
|
2639
|
+
#:startdoc:
|
2640
|
+
|
2641
|
+
def to_s
|
2642
|
+
if self.respond_to?(:name) then
|
2643
|
+
return self.name
|
2644
|
+
else
|
2645
|
+
return super
|
2641
2646
|
end
|
2642
2647
|
end
|
2648
|
+
|
2643
2649
|
end
|
2644
2650
|
|
2645
2651
|
class Device
|
@@ -2767,7 +2773,6 @@ module OpenCL
|
|
2767
2773
|
INTEROP_USER_SYNC = 0x1085
|
2768
2774
|
MEMORY_INITIALIZE_KHR = 0x200E
|
2769
2775
|
TERMINATE_KHR = 0x2010
|
2770
|
-
#:startdoc:
|
2771
2776
|
|
2772
2777
|
# Creates a new Context and retains it if specified and aplicable
|
2773
2778
|
def initialize(ptr, retain = true)
|
@@ -2776,14 +2781,6 @@ module OpenCL
|
|
2776
2781
|
#STDERR.puts "Allocating Context: #{ptr}"
|
2777
2782
|
end
|
2778
2783
|
|
2779
|
-
def to_s
|
2780
|
-
if self.respond_to?(:name) then
|
2781
|
-
return self.name
|
2782
|
-
else
|
2783
|
-
return super
|
2784
|
-
end
|
2785
|
-
end
|
2786
|
-
|
2787
2784
|
# method called at Context deletion, releases the object if aplicable
|
2788
2785
|
def self.release(ptr)
|
2789
2786
|
#STDERR.puts "Releasing Context: #{ptr}"
|
@@ -2792,8 +2789,18 @@ module OpenCL
|
|
2792
2789
|
#STDERR.puts "reference counter: #{ref_count.read_cl_uint}"
|
2793
2790
|
error = OpenCL.clReleaseContext(ptr)
|
2794
2791
|
#STDERR.puts "Object released! #{error}"
|
2795
|
-
|
2792
|
+
error_check( error )
|
2796
2793
|
end
|
2794
|
+
#:startdoc:
|
2795
|
+
|
2796
|
+
def to_s
|
2797
|
+
if self.respond_to?(:name) then
|
2798
|
+
return self.name
|
2799
|
+
else
|
2800
|
+
return super
|
2801
|
+
end
|
2802
|
+
end
|
2803
|
+
|
2797
2804
|
end
|
2798
2805
|
|
2799
2806
|
class CommandQueue < FFI::ManagedStruct
|
@@ -2808,7 +2815,6 @@ module OpenCL
|
|
2808
2815
|
REFERENCE_COUNT = 0x1092
|
2809
2816
|
PROPERTIES = 0x1093
|
2810
2817
|
SIZE = 0x1094
|
2811
|
-
#:startdoc:
|
2812
2818
|
|
2813
2819
|
# Creates a new CommandQueue and retains it if specified and aplicable
|
2814
2820
|
def initialize(ptr, retain = true)
|
@@ -2817,14 +2823,6 @@ module OpenCL
|
|
2817
2823
|
#STDERR.puts "Allocating CommandQueue: #{ptr}"
|
2818
2824
|
end
|
2819
2825
|
|
2820
|
-
def to_s
|
2821
|
-
if self.respond_to?(:name) then
|
2822
|
-
return self.name
|
2823
|
-
else
|
2824
|
-
return super
|
2825
|
-
end
|
2826
|
-
end
|
2827
|
-
|
2828
2826
|
# method called at CommandQueue deletion, releases the object if aplicable
|
2829
2827
|
def self.release(ptr)
|
2830
2828
|
#STDERR.puts "Releasing CommandQueue: #{ptr}"
|
@@ -2833,8 +2831,18 @@ module OpenCL
|
|
2833
2831
|
#STDERR.puts "reference counter: #{ref_count.read_cl_uint}"
|
2834
2832
|
error = OpenCL.clReleaseCommandQueue(ptr)
|
2835
2833
|
#STDERR.puts "Object released! #{error}"
|
2836
|
-
|
2834
|
+
error_check( error )
|
2837
2835
|
end
|
2836
|
+
#:startdoc:
|
2837
|
+
|
2838
|
+
def to_s
|
2839
|
+
if self.respond_to?(:name) then
|
2840
|
+
return self.name
|
2841
|
+
else
|
2842
|
+
return super
|
2843
|
+
end
|
2844
|
+
end
|
2845
|
+
|
2838
2846
|
end
|
2839
2847
|
|
2840
2848
|
class CommandQueue
|
@@ -2891,7 +2899,6 @@ module OpenCL
|
|
2891
2899
|
HOST_WRITETHROUGH_QCOM = 0x40A6
|
2892
2900
|
HOST_WRITE_COMBINING_QCOM = 0x40A7
|
2893
2901
|
ION_HOST_PTR_QCOM = 0x40A8
|
2894
|
-
#:startdoc:
|
2895
2902
|
|
2896
2903
|
# Creates a new Mem and retains it if specified and aplicable
|
2897
2904
|
def initialize(ptr, retain = true)
|
@@ -2900,14 +2907,6 @@ module OpenCL
|
|
2900
2907
|
#STDERR.puts "Allocating Mem: #{ptr}"
|
2901
2908
|
end
|
2902
2909
|
|
2903
|
-
def to_s
|
2904
|
-
if self.respond_to?(:name) then
|
2905
|
-
return self.name
|
2906
|
-
else
|
2907
|
-
return super
|
2908
|
-
end
|
2909
|
-
end
|
2910
|
-
|
2911
2910
|
# method called at Mem deletion, releases the object if aplicable
|
2912
2911
|
def self.release(ptr)
|
2913
2912
|
#STDERR.puts "Releasing Mem: #{ptr}"
|
@@ -2916,8 +2915,18 @@ module OpenCL
|
|
2916
2915
|
#STDERR.puts "reference counter: #{ref_count.read_cl_uint}"
|
2917
2916
|
error = OpenCL.clReleaseMemObject(ptr)
|
2918
2917
|
#STDERR.puts "Object released! #{error}"
|
2919
|
-
|
2918
|
+
error_check( error )
|
2919
|
+
end
|
2920
|
+
#:startdoc:
|
2921
|
+
|
2922
|
+
def to_s
|
2923
|
+
if self.respond_to?(:name) then
|
2924
|
+
return self.name
|
2925
|
+
else
|
2926
|
+
return super
|
2927
|
+
end
|
2920
2928
|
end
|
2929
|
+
|
2921
2930
|
end
|
2922
2931
|
|
2923
2932
|
class Mem
|
@@ -3020,7 +3029,6 @@ module OpenCL
|
|
3020
3029
|
BINARY_TYPE_LIBRARY = 0x2
|
3021
3030
|
BINARY_TYPE_EXECUTABLE = 0x4
|
3022
3031
|
BINARY_TYPE_INTERMEDIATE = 0x40E1
|
3023
|
-
#:startdoc:
|
3024
3032
|
|
3025
3033
|
# Creates a new Program and retains it if specified and aplicable
|
3026
3034
|
def initialize(ptr, retain = true)
|
@@ -3029,14 +3037,6 @@ module OpenCL
|
|
3029
3037
|
#STDERR.puts "Allocating Program: #{ptr}"
|
3030
3038
|
end
|
3031
3039
|
|
3032
|
-
def to_s
|
3033
|
-
if self.respond_to?(:name) then
|
3034
|
-
return self.name
|
3035
|
-
else
|
3036
|
-
return super
|
3037
|
-
end
|
3038
|
-
end
|
3039
|
-
|
3040
3040
|
# method called at Program deletion, releases the object if aplicable
|
3041
3041
|
def self.release(ptr)
|
3042
3042
|
#STDERR.puts "Releasing Program: #{ptr}"
|
@@ -3045,8 +3045,18 @@ module OpenCL
|
|
3045
3045
|
#STDERR.puts "reference counter: #{ref_count.read_cl_uint}"
|
3046
3046
|
error = OpenCL.clReleaseProgram(ptr)
|
3047
3047
|
#STDERR.puts "Object released! #{error}"
|
3048
|
-
|
3048
|
+
error_check( error )
|
3049
|
+
end
|
3050
|
+
#:startdoc:
|
3051
|
+
|
3052
|
+
def to_s
|
3053
|
+
if self.respond_to?(:name) then
|
3054
|
+
return self.name
|
3055
|
+
else
|
3056
|
+
return super
|
3057
|
+
end
|
3049
3058
|
end
|
3059
|
+
|
3050
3060
|
end
|
3051
3061
|
|
3052
3062
|
class Program
|
@@ -3104,7 +3114,6 @@ module OpenCL
|
|
3104
3114
|
GLOBAL_WORK_SIZE = 0x11B5
|
3105
3115
|
EXEC_INFO_SVM_PTRS = 0x11B6
|
3106
3116
|
EXEC_INFO_SVM_FINE_GRAIN_SYSTEM = 0x11B7
|
3107
|
-
#:startdoc:
|
3108
3117
|
|
3109
3118
|
# Creates a new Kernel and retains it if specified and aplicable
|
3110
3119
|
def initialize(ptr, retain = true)
|
@@ -3113,14 +3122,6 @@ module OpenCL
|
|
3113
3122
|
#STDERR.puts "Allocating Kernel: #{ptr}"
|
3114
3123
|
end
|
3115
3124
|
|
3116
|
-
def to_s
|
3117
|
-
if self.respond_to?(:name) then
|
3118
|
-
return self.name
|
3119
|
-
else
|
3120
|
-
return super
|
3121
|
-
end
|
3122
|
-
end
|
3123
|
-
|
3124
3125
|
# method called at Kernel deletion, releases the object if aplicable
|
3125
3126
|
def self.release(ptr)
|
3126
3127
|
#STDERR.puts "Releasing Kernel: #{ptr}"
|
@@ -3129,8 +3130,18 @@ module OpenCL
|
|
3129
3130
|
#STDERR.puts "reference counter: #{ref_count.read_cl_uint}"
|
3130
3131
|
error = OpenCL.clReleaseKernel(ptr)
|
3131
3132
|
#STDERR.puts "Object released! #{error}"
|
3132
|
-
|
3133
|
+
error_check( error )
|
3133
3134
|
end
|
3135
|
+
#:startdoc:
|
3136
|
+
|
3137
|
+
def to_s
|
3138
|
+
if self.respond_to?(:name) then
|
3139
|
+
return self.name
|
3140
|
+
else
|
3141
|
+
return super
|
3142
|
+
end
|
3143
|
+
end
|
3144
|
+
|
3134
3145
|
end
|
3135
3146
|
|
3136
3147
|
class Kernel
|
@@ -3216,7 +3227,6 @@ module OpenCL
|
|
3216
3227
|
REFERENCE_COUNT = 0x11D2
|
3217
3228
|
COMMAND_EXECUTION_STATUS = 0x11D3
|
3218
3229
|
CONTEXT = 0x11D4
|
3219
|
-
#:startdoc:
|
3220
3230
|
|
3221
3231
|
# Creates a new Event and retains it if specified and aplicable
|
3222
3232
|
def initialize(ptr, retain = true)
|
@@ -3225,14 +3235,6 @@ module OpenCL
|
|
3225
3235
|
#STDERR.puts "Allocating Event: #{ptr}"
|
3226
3236
|
end
|
3227
3237
|
|
3228
|
-
def to_s
|
3229
|
-
if self.respond_to?(:name) then
|
3230
|
-
return self.name
|
3231
|
-
else
|
3232
|
-
return super
|
3233
|
-
end
|
3234
|
-
end
|
3235
|
-
|
3236
3238
|
# method called at Event deletion, releases the object if aplicable
|
3237
3239
|
def self.release(ptr)
|
3238
3240
|
#STDERR.puts "Releasing Event: #{ptr}"
|
@@ -3241,8 +3243,18 @@ module OpenCL
|
|
3241
3243
|
#STDERR.puts "reference counter: #{ref_count.read_cl_uint}"
|
3242
3244
|
error = OpenCL.clReleaseEvent(ptr)
|
3243
3245
|
#STDERR.puts "Object released! #{error}"
|
3244
|
-
|
3246
|
+
error_check( error )
|
3247
|
+
end
|
3248
|
+
#:startdoc:
|
3249
|
+
|
3250
|
+
def to_s
|
3251
|
+
if self.respond_to?(:name) then
|
3252
|
+
return self.name
|
3253
|
+
else
|
3254
|
+
return super
|
3255
|
+
end
|
3245
3256
|
end
|
3257
|
+
|
3246
3258
|
end
|
3247
3259
|
|
3248
3260
|
class Sampler < FFI::ManagedStruct
|
@@ -3256,7 +3268,6 @@ module OpenCL
|
|
3256
3268
|
MIP_FILTER_MODE = 0x1155
|
3257
3269
|
LOD_MIN = 0x1156
|
3258
3270
|
LOD_MAX = 0x1157
|
3259
|
-
#:startdoc:
|
3260
3271
|
|
3261
3272
|
# Creates a new Sampler and retains it if specified and aplicable
|
3262
3273
|
def initialize(ptr, retain = true)
|
@@ -3265,14 +3276,6 @@ module OpenCL
|
|
3265
3276
|
#STDERR.puts "Allocating Sampler: #{ptr}"
|
3266
3277
|
end
|
3267
3278
|
|
3268
|
-
def to_s
|
3269
|
-
if self.respond_to?(:name) then
|
3270
|
-
return self.name
|
3271
|
-
else
|
3272
|
-
return super
|
3273
|
-
end
|
3274
|
-
end
|
3275
|
-
|
3276
3279
|
# method called at Sampler deletion, releases the object if aplicable
|
3277
3280
|
def self.release(ptr)
|
3278
3281
|
#STDERR.puts "Releasing Sampler: #{ptr}"
|
@@ -3281,8 +3284,18 @@ module OpenCL
|
|
3281
3284
|
#STDERR.puts "reference counter: #{ref_count.read_cl_uint}"
|
3282
3285
|
error = OpenCL.clReleaseSampler(ptr)
|
3283
3286
|
#STDERR.puts "Object released! #{error}"
|
3284
|
-
|
3287
|
+
error_check( error )
|
3288
|
+
end
|
3289
|
+
#:startdoc:
|
3290
|
+
|
3291
|
+
def to_s
|
3292
|
+
if self.respond_to?(:name) then
|
3293
|
+
return self.name
|
3294
|
+
else
|
3295
|
+
return super
|
3296
|
+
end
|
3285
3297
|
end
|
3298
|
+
|
3286
3299
|
end
|
3287
3300
|
|
3288
3301
|
class Sampler
|
@@ -3311,7 +3324,6 @@ module OpenCL
|
|
3311
3324
|
layout :dummy, :pointer
|
3312
3325
|
#:stopdoc:
|
3313
3326
|
|
3314
|
-
#:startdoc:
|
3315
3327
|
|
3316
3328
|
# Creates a new GLsync and retains it if specified and aplicable
|
3317
3329
|
def initialize(ptr, retain = true)
|
@@ -3319,6 +3331,11 @@ module OpenCL
|
|
3319
3331
|
#STDERR.puts "Allocating GLsync: #{ptr}"
|
3320
3332
|
end
|
3321
3333
|
|
3334
|
+
# method called at GLsync deletion, releases the object if aplicable
|
3335
|
+
def self.release(ptr)
|
3336
|
+
end
|
3337
|
+
#:startdoc:
|
3338
|
+
|
3322
3339
|
def to_s
|
3323
3340
|
if self.respond_to?(:name) then
|
3324
3341
|
return self.name
|
@@ -3327,9 +3344,6 @@ module OpenCL
|
|
3327
3344
|
end
|
3328
3345
|
end
|
3329
3346
|
|
3330
|
-
# method called at GLsync deletion, releases the object if aplicable
|
3331
|
-
def self.release(ptr)
|
3332
|
-
end
|
3333
3347
|
end
|
3334
3348
|
|
3335
3349
|
# Enum that maps the :cl_channel_order type
|
data/opencl_ruby_ffi.gemspec
CHANGED
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.
|
4
|
+
version: '0.995'
|
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-10-
|
12
|
+
date: 2014-10-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: narray
|