opencl_ruby_ffi 0.993 → 0.994
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/opencl_ruby_ffi/Buffer.rb +13 -13
- data/lib/opencl_ruby_ffi/CommandQueue.rb +177 -177
- data/lib/opencl_ruby_ffi/Context.rb +11 -13
- data/lib/opencl_ruby_ffi/Device.rb +20 -20
- data/lib/opencl_ruby_ffi/Event.rb +22 -20
- data/lib/opencl_ruby_ffi/Image.rb +42 -42
- data/lib/opencl_ruby_ffi/Kernel.rb +28 -28
- data/lib/opencl_ruby_ffi/Mem.rb +9 -8
- data/lib/opencl_ruby_ffi/Pipe.rb +5 -5
- data/lib/opencl_ruby_ffi/Platform.rb +17 -17
- data/lib/opencl_ruby_ffi/Program.rb +32 -32
- data/lib/opencl_ruby_ffi/SVM.rb +42 -42
- data/lib/opencl_ruby_ffi/Sampler.rb +14 -14
- data/lib/opencl_ruby_ffi/opencl_ruby_ffi_base.rb +29 -29
- data/lib/opencl_ruby_ffi/opencl_ruby_ffi_base_gen.rb +1 -55
- data/opencl_ruby_ffi.gemspec +2 -2
- metadata +3 -3
@@ -13,12 +13,12 @@ module OpenCL
|
|
13
13
|
# * +:flags+ - a single or an Array of :cl_mem_flags specifying the flags to be used when creating the Buffer
|
14
14
|
# * +:host_ptr+ - if provided, the Pointer (or convertible to Pointer using to_ptr) to the memory area to use
|
15
15
|
def self.create_buffer( context, size, options = {} )
|
16
|
-
flags =
|
16
|
+
flags = get_flags( options )
|
17
17
|
host_ptr = options[:host_ptr]
|
18
18
|
error = FFI::MemoryPointer::new( :cl_int )
|
19
|
-
buff =
|
20
|
-
|
21
|
-
return
|
19
|
+
buff = clCreateBuffer(context, flags, size, host_ptr, error)
|
20
|
+
error_check(error.read_cl_int)
|
21
|
+
return Buffer::new( buff, false )
|
22
22
|
end
|
23
23
|
|
24
24
|
# Creates a Buffer from a sub part of an existing Buffer
|
@@ -34,12 +34,12 @@ module OpenCL
|
|
34
34
|
#
|
35
35
|
# * +:flags+ - a single or an Array of :cl_mem_flags specifying the flags to be used when creating the Buffer
|
36
36
|
def self.create_sub_buffer( buffer, type, info, options = {} )
|
37
|
-
|
38
|
-
flags =
|
37
|
+
error_check(INVALID_OPERATION) if buffer.platform.version_number < 1.1
|
38
|
+
flags = get_flags( options )
|
39
39
|
error = FFI::MemoryPointer::new( :cl_int )
|
40
|
-
buff =
|
41
|
-
|
42
|
-
return
|
40
|
+
buff = clCreateSubBuffer( buffer, flags, type, info, error)
|
41
|
+
error_check(error.read_cl_int)
|
42
|
+
return Buffer::new( buff, false )
|
43
43
|
end
|
44
44
|
|
45
45
|
# Creates Buffer from an opengl buffer
|
@@ -54,11 +54,11 @@ module OpenCL
|
|
54
54
|
#
|
55
55
|
# * +:flags+ - a single or an Array of :cl_mem_flags specifying the flags to be used when creating the Image
|
56
56
|
def self.create_from_GL_buffer( context, bufobj, options = {} )
|
57
|
-
flags =
|
57
|
+
flags = get_flags( options )
|
58
58
|
error = FFI::MemoryPointer::new( :cl_int )
|
59
|
-
buff =
|
60
|
-
|
61
|
-
return
|
59
|
+
buff = clCreateFromGLBuffer( context, flags, bufobj, error )
|
60
|
+
error_check(error.read_cl_int)
|
61
|
+
return Buffer::new( buff, false )
|
62
62
|
end
|
63
63
|
|
64
64
|
# Maps the cl_mem OpenCL object of type CL_MEM_OBJECT_BUFFER
|