Module: OpenCL::Context::UnifiedSharedMemoryPreviewINTEL
- Included in:
- OpenCL::Context
- Defined in:
- lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb
Instance Method Summary collapse
- #clDeviceMemAllocINTEL ⇒ Object
- #clGetMemAllocInfoINTEL ⇒ Object
- #clHostMemAllocINTEL ⇒ Object
- #clMemFreeINTEL ⇒ Object
- #clSharedMemAllocINTEL ⇒ Object
- #device_mem_alloc_intel(device, size, options = {}) ⇒ Object
- #host_mem_alloc_intel(size, options = {}) ⇒ Object
- #mem_alloc_base_ptr_intel(ptr) ⇒ Object
- #mem_alloc_device_intel(ptr) ⇒ Object
- #mem_alloc_flags_intel(ptr) ⇒ Object
- #mem_alloc_size_intel(ptr) ⇒ Object
- #mem_alloc_type_intel(ptr) ⇒ Object
- #mem_free_intel(ptr) ⇒ Object
- #shared_mem_alloc_intel(device, size, options = {}) ⇒ Object
Instance Method Details
#clDeviceMemAllocINTEL ⇒ Object
317 318 319 320 321 322 323 |
# File 'lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb', line 317 def clDeviceMemAllocINTEL @_clDeviceMemAllocINTEL ||= begin p = platform.get_extension_function("clDeviceMemAllocINTEL", :pointer, [Context, Device, :pointer, :size_t, :cl_uint, :pointer]) error_check(OpenCL::INVALID_OPERATION) unless p p end end |
#clGetMemAllocInfoINTEL ⇒ Object
301 302 303 304 305 306 307 |
# File 'lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb', line 301 def clGetMemAllocInfoINTEL @_clGetMemAllocInfoINTEL ||= begin p = platform.get_extension_function("clGetMemAllocInfoINTEL", :cl_int, [Context, :pointer, :cl_mem_info_intel, :size_t, :pointer, :pointer]) error_check(OpenCL::INVALID_OPERATION) unless p p end end |
#clHostMemAllocINTEL ⇒ Object
309 310 311 312 313 314 315 |
# File 'lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb', line 309 def clHostMemAllocINTEL @_clHostMemAllocINTEL ||= begin p = platform.get_extension_function("clHostMemAllocINTEL", :pointer, [Context, :pointer, :size_t, :cl_uint, :pointer]) error_check(OpenCL::INVALID_OPERATION) unless p p end end |
#clMemFreeINTEL ⇒ Object
333 334 335 336 337 338 339 |
# File 'lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb', line 333 def clMemFreeINTEL return @_clMemFreeINTEL ||= begin p = platform.get_extension_function("clMemFreeINTEL", :cl_int, [Context, :pointer]) error_check(OpenCL::INVALID_OPERATION) unless p p end end |
#clSharedMemAllocINTEL ⇒ Object
325 326 327 328 329 330 331 |
# File 'lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb', line 325 def clSharedMemAllocINTEL @_clSharedMemAllocINTEL ||= begin p = platform.get_extension_function("clSharedMemAllocINTEL", :pointer, [Context, Device, :pointer, :size_t, :cl_uint, :pointer]) error_check(OpenCL::INVALID_OPERATION) unless p p end end |
#device_mem_alloc_intel(device, size, options = {}) ⇒ Object
364 365 366 367 368 369 370 371 372 |
# File 'lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb', line 364 def device_mem_alloc_intel(device, size, = {}) properties = get_mem_properties_intel([:properties]) alignment = 0 alignment = [:alignment] if [:alignment] error = MemoryPointer::new( :cl_int ) ptr = clDeviceMemAllocINTEL.call(self, device, properties, size, alignment, error) error_check(error.read_cl_int) return USMPointer::new(ptr.slice(0, size), self) end |
#host_mem_alloc_intel(size, options = {}) ⇒ Object
354 355 356 357 358 359 360 361 362 |
# File 'lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb', line 354 def host_mem_alloc_intel(size, = {}) properties = get_mem_properties_intel([:properties]) alignment = 0 alignment = [:alignment] if [:alignment] error = MemoryPointer::new( :cl_int ) ptr = clHostMemAllocINTEL.call(self, properties, size, alignment, error) error_check(error.read_cl_int) return USMPointer::new(ptr.slice(0, size), self) end |
#mem_alloc_base_ptr_intel(ptr) ⇒ Object
404 405 406 407 408 409 |
# File 'lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb', line 404 def mem_alloc_base_ptr_intel(ptr) ptr_res = MemoryPointer::new(:pointer) error = clGetMemAllocInfoINTEL.call(self, ptr, OpenCL::Mem::ALLOC_BASE_PTR_INTEL, ptr_res.size, ptr_res, nil) error_check(error) return ptr_res.read_pointer end |
#mem_alloc_device_intel(ptr) ⇒ Object
418 419 420 421 422 423 |
# File 'lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb', line 418 def mem_alloc_device_intel(ptr) ptr_res = MemoryPointer::new( Device ) error = OpenCL.clGetMemAllocInfoINTEL.call(self, ptr, OpenCL::Mem::ALLOC_DEVICE_INTEL, Device.size, ptr_res, nil) error_check(error) return Device::new(ptr_res.read_pointer) end |
#mem_alloc_flags_intel(ptr) ⇒ Object
397 398 399 400 401 402 |
# File 'lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb', line 397 def mem_alloc_flags_intel(ptr) ptr_res = MemoryPointer::new(:cl_mem_alloc_flags_intel) error = clGetMemAllocInfoINTEL.call(self, ptr, OpenCL::Mem::ALLOC_FLAGS_INTEL, ptr_res.size, ptr_res, nil) error_check(error) return OpenCL::Mem::AllocFlagsINTEL::new(ptr_res.read_cl_mem_alloc_flags_intel) end |
#mem_alloc_size_intel(ptr) ⇒ Object
411 412 413 414 415 416 |
# File 'lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb', line 411 def mem_alloc_size_intel(ptr) ptr_res = MemoryPointer::new(:size_t) error = clGetMemAllocInfoINTEL.call(self, ptr, OpenCL::Mem::ALLOC_SIZE_INTEL, ptr_res.size, ptr_res, nil) error_check(error) return ptr_res.read_size_t end |
#mem_alloc_type_intel(ptr) ⇒ Object
390 391 392 393 394 395 |
# File 'lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb', line 390 def mem_alloc_type_intel(ptr) ptr_res = MemoryPointer::new(:cl_unified_shared_memory_type_intel) error = clGetMemAllocInfoINTEL.call(self, ptr, OpenCL::Mem::ALLOC_TYPE_INTEL, ptr_res.size, ptr_res, nil) error_check(error) return OpenCL::Mem::UnifiedSharedMemoryTypeINTEL::new(ptr_res.read_cl_unified_shared_memory_type_intel) end |
#mem_free_intel(ptr) ⇒ Object
384 385 386 387 388 |
# File 'lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb', line 384 def mem_free_intel(ptr) error = clMemFreeINTEL.call(self, ptr) error_check(error) return self end |
#shared_mem_alloc_intel(device, size, options = {}) ⇒ Object
374 375 376 377 378 379 380 381 382 |
# File 'lib/opencl_ruby_ffi/intel/unified_shared_memory_preview.rb', line 374 def shared_mem_alloc_intel(device, size, = {}) properties = get_mem_properties_intel([:properties]) alignment = 0 alignment = [:alignment] if [:alignment] error = MemoryPointer::new( :cl_int ) ptr = clSharedMemAllocINTEL.call(self, device, properties, size, alignment, error) error_check(error.read_cl_int) return USMPointer::new(ptr.slice(0, size), self) end |