mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-07 03:20:28 +01:00
rusticl/icd: rename all entry points to the actual correct name
Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29855>
This commit is contained in:
parent
be090abf2e
commit
cdd604583f
10 changed files with 276 additions and 281 deletions
|
|
@ -19,7 +19,7 @@ use std::mem::MaybeUninit;
|
|||
use std::ptr;
|
||||
use std::slice;
|
||||
|
||||
#[cl_info_entrypoint(cl_get_context_info)]
|
||||
#[cl_info_entrypoint(clGetContextInfo)]
|
||||
impl CLInfo<cl_context_info> for cl_context {
|
||||
fn query(&self, q: cl_context_info, _: &[u8]) -> CLResult<Vec<MaybeUninit<u8>>> {
|
||||
let ctx = Context::ref_from_raw(*self)?;
|
||||
|
|
@ -64,7 +64,7 @@ impl CLInfo<cl_gl_context_info> for GLCtxManager {
|
|||
}
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clGetGLContextInfoKHR)]
|
||||
pub fn get_gl_context_info_khr(
|
||||
properties: *const cl_context_properties,
|
||||
param_name: cl_gl_context_info,
|
||||
|
|
@ -109,7 +109,7 @@ pub fn get_gl_context_info_khr(
|
|||
)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCreateContext)]
|
||||
fn create_context(
|
||||
properties: *const cl_context_properties,
|
||||
num_devices: cl_uint,
|
||||
|
|
@ -196,7 +196,7 @@ fn create_context(
|
|||
Ok(Context::new(devs, props, gl_ctx_manager).into_cl())
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCreateContextFromType)]
|
||||
fn create_context_from_type(
|
||||
properties: *const cl_context_properties,
|
||||
device_type: cl_device_type,
|
||||
|
|
@ -227,17 +227,17 @@ fn create_context_from_type(
|
|||
)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clRetainContext)]
|
||||
fn retain_context(context: cl_context) -> CLResult<()> {
|
||||
Context::retain(context)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clReleaseContext)]
|
||||
fn release_context(context: cl_context) -> CLResult<()> {
|
||||
Context::release(context)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clSetContextDestructorCallback)]
|
||||
fn set_context_destructor_callback(
|
||||
context: cl_context,
|
||||
pfn_notify: ::std::option::Option<FuncDeleteContextCB>,
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ const SPIRV_SUPPORT: [cl_name_version; 5] = [
|
|||
];
|
||||
type ClDevIdpAccelProps = cl_device_integer_dot_product_acceleration_properties_khr;
|
||||
|
||||
#[cl_info_entrypoint(cl_get_device_info)]
|
||||
#[cl_info_entrypoint(clGetDeviceInfo)]
|
||||
impl CLInfo<cl_device_info> for cl_device_id {
|
||||
fn query(&self, q: cl_device_info, _: &[u8]) -> CLResult<Vec<MaybeUninit<u8>>> {
|
||||
let dev = Device::ref_from_raw(*self)?;
|
||||
|
|
@ -316,7 +316,7 @@ impl CLInfo<cl_device_info> for cl_device_id {
|
|||
}
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clGetDeviceIDs)]
|
||||
fn get_device_ids(
|
||||
platform: cl_platform_id,
|
||||
device_type: cl_device_type,
|
||||
|
|
@ -364,17 +364,17 @@ fn get_device_ids(
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clRetainDevice)]
|
||||
fn retain_device(_device: cl_device_id) -> CLResult<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clReleaseDevice)]
|
||||
fn release_device(_device: cl_device_id) -> CLResult<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clGetDeviceAndHostTimer)]
|
||||
fn get_device_and_host_timer(
|
||||
device: cl_device_id,
|
||||
device_timestamp: *mut cl_ulong,
|
||||
|
|
@ -400,7 +400,7 @@ fn get_device_and_host_timer(
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clGetHostTimer)]
|
||||
fn get_host_timer(device_id: cl_device_id, host_timestamp: *mut cl_ulong) -> CLResult<()> {
|
||||
if host_timestamp.is_null() {
|
||||
// CL_INVALID_VALUE if host_timestamp is NULL
|
||||
|
|
@ -420,7 +420,7 @@ fn get_host_timer(device_id: cl_device_id, host_timestamp: *mut cl_ulong) -> CLR
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clSetDefaultDeviceCommandQueue)]
|
||||
fn set_default_device_command_queue(
|
||||
_context: cl_context,
|
||||
_device: cl_device_id,
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ use std::mem::MaybeUninit;
|
|||
use std::ptr;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[cl_info_entrypoint(cl_get_event_info)]
|
||||
#[cl_info_entrypoint(clGetEventInfo)]
|
||||
impl CLInfo<cl_event_info> for cl_event {
|
||||
fn query(&self, q: cl_event_info, _: &[u8]) -> CLResult<Vec<MaybeUninit<u8>>> {
|
||||
let event = Event::ref_from_raw(*self)?;
|
||||
|
|
@ -40,7 +40,7 @@ impl CLInfo<cl_event_info> for cl_event {
|
|||
}
|
||||
}
|
||||
|
||||
#[cl_info_entrypoint(cl_get_event_profiling_info)]
|
||||
#[cl_info_entrypoint(clGetEventProfilingInfo)]
|
||||
impl CLInfo<cl_profiling_info> for cl_event {
|
||||
fn query(&self, q: cl_profiling_info, _: &[u8]) -> CLResult<Vec<MaybeUninit<u8>>> {
|
||||
let event = Event::ref_from_raw(*self)?;
|
||||
|
|
@ -61,23 +61,23 @@ impl CLInfo<cl_profiling_info> for cl_event {
|
|||
}
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCreateUserEvent)]
|
||||
fn create_user_event(context: cl_context) -> CLResult<cl_event> {
|
||||
let c = Context::arc_from_raw(context)?;
|
||||
Ok(Event::new_user(c).into_cl())
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clRetainEvent)]
|
||||
fn retain_event(event: cl_event) -> CLResult<()> {
|
||||
Event::retain(event)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clReleaseEvent)]
|
||||
fn release_event(event: cl_event) -> CLResult<()> {
|
||||
Event::release(event)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clWaitForEvents)]
|
||||
fn wait_for_events(num_events: cl_uint, event_list: *const cl_event) -> CLResult<()> {
|
||||
let evs = Event::arcs_from_arr(event_list, num_events)?;
|
||||
|
||||
|
|
@ -112,7 +112,7 @@ fn wait_for_events(num_events: cl_uint, event_list: *const cl_event) -> CLResult
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clSetEventCallback)]
|
||||
fn set_event_callback(
|
||||
event: cl_event,
|
||||
command_exec_callback_type: cl_int,
|
||||
|
|
@ -135,7 +135,7 @@ fn set_event_callback(
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clSetUserEventStatus)]
|
||||
fn set_user_event_status(event: cl_event, execution_status: cl_int) -> CLResult<()> {
|
||||
let e = Event::ref_from_raw(event)?;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ use crate::api::device::*;
|
|||
use crate::api::event::*;
|
||||
use crate::api::kernel::*;
|
||||
use crate::api::memory::*;
|
||||
use crate::api::platform;
|
||||
use crate::api::platform::*;
|
||||
use crate::api::program::*;
|
||||
use crate::api::queue::*;
|
||||
|
|
@ -21,115 +22,115 @@ use std::ptr;
|
|||
use std::sync::Arc;
|
||||
|
||||
pub static DISPATCH: cl_icd_dispatch = cl_icd_dispatch {
|
||||
clGetPlatformIDs: Some(cl_get_platform_ids),
|
||||
clGetPlatformInfo: Some(cl_get_platform_info),
|
||||
clGetDeviceIDs: Some(cl_get_device_ids),
|
||||
clGetDeviceInfo: Some(cl_get_device_info),
|
||||
clCreateContext: Some(cl_create_context),
|
||||
clCreateContextFromType: Some(cl_create_context_from_type),
|
||||
clRetainContext: Some(cl_retain_context),
|
||||
clReleaseContext: Some(cl_release_context),
|
||||
clGetContextInfo: Some(cl_get_context_info),
|
||||
clCreateCommandQueue: Some(cl_create_command_queue),
|
||||
clRetainCommandQueue: Some(cl_retain_command_queue),
|
||||
clReleaseCommandQueue: Some(cl_release_command_queue),
|
||||
clGetCommandQueueInfo: Some(cl_get_command_queue_info),
|
||||
clGetPlatformIDs: Some(clGetPlatformIDs),
|
||||
clGetPlatformInfo: Some(clGetPlatformInfo),
|
||||
clGetDeviceIDs: Some(clGetDeviceIDs),
|
||||
clGetDeviceInfo: Some(clGetDeviceInfo),
|
||||
clCreateContext: Some(clCreateContext),
|
||||
clCreateContextFromType: Some(clCreateContextFromType),
|
||||
clRetainContext: Some(clRetainContext),
|
||||
clReleaseContext: Some(clReleaseContext),
|
||||
clGetContextInfo: Some(clGetContextInfo),
|
||||
clCreateCommandQueue: Some(clCreateCommandQueue),
|
||||
clRetainCommandQueue: Some(clRetainCommandQueue),
|
||||
clReleaseCommandQueue: Some(clReleaseCommandQueue),
|
||||
clGetCommandQueueInfo: Some(clGetCommandQueueInfo),
|
||||
clSetCommandQueueProperty: None,
|
||||
clCreateBuffer: Some(cl_create_buffer),
|
||||
clCreateImage2D: Some(cl_create_image_2d),
|
||||
clCreateImage3D: Some(cl_create_image_3d),
|
||||
clRetainMemObject: Some(cl_retain_mem_object),
|
||||
clReleaseMemObject: Some(cl_release_mem_object),
|
||||
clGetSupportedImageFormats: Some(cl_get_supported_image_formats),
|
||||
clGetMemObjectInfo: Some(cl_get_mem_object_info),
|
||||
clGetImageInfo: Some(cl_get_image_info),
|
||||
clCreateSampler: Some(cl_create_sampler),
|
||||
clRetainSampler: Some(cl_retain_sampler),
|
||||
clReleaseSampler: Some(cl_release_sampler),
|
||||
clGetSamplerInfo: Some(cl_get_sampler_info),
|
||||
clCreateProgramWithSource: Some(cl_create_program_with_source),
|
||||
clCreateProgramWithBinary: Some(cl_create_program_with_binary),
|
||||
clRetainProgram: Some(cl_retain_program),
|
||||
clReleaseProgram: Some(cl_release_program),
|
||||
clBuildProgram: Some(cl_build_program),
|
||||
clCreateBuffer: Some(clCreateBuffer),
|
||||
clCreateImage2D: Some(clCreateImage2D),
|
||||
clCreateImage3D: Some(clCreateImage3D),
|
||||
clRetainMemObject: Some(clRetainMemObject),
|
||||
clReleaseMemObject: Some(clReleaseMemObject),
|
||||
clGetSupportedImageFormats: Some(clGetSupportedImageFormats),
|
||||
clGetMemObjectInfo: Some(clGetMemObjectInfo),
|
||||
clGetImageInfo: Some(clGetImageInfo),
|
||||
clCreateSampler: Some(clCreateSampler),
|
||||
clRetainSampler: Some(clRetainSampler),
|
||||
clReleaseSampler: Some(clReleaseSampler),
|
||||
clGetSamplerInfo: Some(clGetSamplerInfo),
|
||||
clCreateProgramWithSource: Some(clCreateProgramWithSource),
|
||||
clCreateProgramWithBinary: Some(clCreateProgramWithBinary),
|
||||
clRetainProgram: Some(clRetainProgram),
|
||||
clReleaseProgram: Some(clReleaseProgram),
|
||||
clBuildProgram: Some(clBuildProgram),
|
||||
clUnloadCompiler: None,
|
||||
clGetProgramInfo: Some(cl_get_program_info),
|
||||
clGetProgramBuildInfo: Some(cl_get_program_build_info),
|
||||
clCreateKernel: Some(cl_create_kernel),
|
||||
clCreateKernelsInProgram: Some(cl_create_kernels_in_program),
|
||||
clRetainKernel: Some(cl_retain_kernel),
|
||||
clReleaseKernel: Some(cl_release_kernel),
|
||||
clSetKernelArg: Some(cl_set_kernel_arg),
|
||||
clGetKernelInfo: Some(cl_get_kernel_info),
|
||||
clGetKernelWorkGroupInfo: Some(cl_get_kernel_work_group_info),
|
||||
clWaitForEvents: Some(cl_wait_for_events),
|
||||
clGetEventInfo: Some(cl_get_event_info),
|
||||
clRetainEvent: Some(cl_retain_event),
|
||||
clReleaseEvent: Some(cl_release_event),
|
||||
clGetEventProfilingInfo: Some(cl_get_event_profiling_info),
|
||||
clFlush: Some(cl_flush),
|
||||
clFinish: Some(cl_finish),
|
||||
clEnqueueReadBuffer: Some(cl_enqueue_read_buffer),
|
||||
clEnqueueWriteBuffer: Some(cl_enqueue_write_buffer),
|
||||
clEnqueueCopyBuffer: Some(cl_enqueue_copy_buffer),
|
||||
clEnqueueReadImage: Some(cl_enqueue_read_image),
|
||||
clEnqueueWriteImage: Some(cl_enqueue_write_image),
|
||||
clEnqueueCopyImage: Some(cl_enqueue_copy_image),
|
||||
clEnqueueCopyImageToBuffer: Some(cl_enqueue_copy_image_to_buffer),
|
||||
clEnqueueCopyBufferToImage: Some(cl_enqueue_copy_buffer_to_image),
|
||||
clEnqueueMapBuffer: Some(cl_enqueue_map_buffer),
|
||||
clEnqueueMapImage: Some(cl_enqueue_map_image),
|
||||
clEnqueueUnmapMemObject: Some(cl_enqueue_unmap_mem_object),
|
||||
clEnqueueNDRangeKernel: Some(cl_enqueue_ndrange_kernel),
|
||||
clEnqueueTask: Some(cl_enqueue_task),
|
||||
clGetProgramInfo: Some(clGetProgramInfo),
|
||||
clGetProgramBuildInfo: Some(clGetProgramBuildInfo),
|
||||
clCreateKernel: Some(clCreateKernel),
|
||||
clCreateKernelsInProgram: Some(clCreateKernelsInProgram),
|
||||
clRetainKernel: Some(clRetainKernel),
|
||||
clReleaseKernel: Some(clReleaseKernel),
|
||||
clSetKernelArg: Some(clSetKernelArg),
|
||||
clGetKernelInfo: Some(clGetKernelInfo),
|
||||
clGetKernelWorkGroupInfo: Some(clGetKernelWorkGroupInfo),
|
||||
clWaitForEvents: Some(clWaitForEvents),
|
||||
clGetEventInfo: Some(clGetEventInfo),
|
||||
clRetainEvent: Some(clRetainEvent),
|
||||
clReleaseEvent: Some(clReleaseEvent),
|
||||
clGetEventProfilingInfo: Some(clGetEventProfilingInfo),
|
||||
clFlush: Some(clFlush),
|
||||
clFinish: Some(clFinish),
|
||||
clEnqueueReadBuffer: Some(clEnqueueReadBuffer),
|
||||
clEnqueueWriteBuffer: Some(clEnqueueWriteBuffer),
|
||||
clEnqueueCopyBuffer: Some(clEnqueueCopyBuffer),
|
||||
clEnqueueReadImage: Some(clEnqueueReadImage),
|
||||
clEnqueueWriteImage: Some(clEnqueueWriteImage),
|
||||
clEnqueueCopyImage: Some(clEnqueueCopyImage),
|
||||
clEnqueueCopyImageToBuffer: Some(clEnqueueCopyImageToBuffer),
|
||||
clEnqueueCopyBufferToImage: Some(clEnqueueCopyBufferToImage),
|
||||
clEnqueueMapBuffer: Some(clEnqueueMapBuffer),
|
||||
clEnqueueMapImage: Some(clEnqueueMapImage),
|
||||
clEnqueueUnmapMemObject: Some(clEnqueueUnmapMemObject),
|
||||
clEnqueueNDRangeKernel: Some(clEnqueueNDRangeKernel),
|
||||
clEnqueueTask: Some(clEnqueueTask),
|
||||
clEnqueueNativeKernel: None,
|
||||
clEnqueueMarker: Some(cl_enqueue_marker),
|
||||
clEnqueueMarker: Some(clEnqueueMarker),
|
||||
clEnqueueWaitForEvents: None,
|
||||
clEnqueueBarrier: Some(cl_enqueue_barrier),
|
||||
clGetExtensionFunctionAddress: Some(cl_get_extension_function_address),
|
||||
clCreateFromGLBuffer: Some(cl_create_from_gl_buffer),
|
||||
clCreateFromGLTexture2D: Some(cl_create_from_gl_texture_2d),
|
||||
clCreateFromGLTexture3D: Some(cl_create_from_gl_texture_3d),
|
||||
clCreateFromGLRenderbuffer: Some(cl_create_from_gl_renderbuffer),
|
||||
clGetGLObjectInfo: Some(cl_get_gl_object_info),
|
||||
clGetGLTextureInfo: Some(cl_get_gl_texture_info),
|
||||
clEnqueueAcquireGLObjects: Some(cl_enqueue_acquire_gl_objects),
|
||||
clEnqueueReleaseGLObjects: Some(cl_enqueue_release_gl_objects),
|
||||
clGetGLContextInfoKHR: Some(cl_get_gl_context_info_khr),
|
||||
clEnqueueBarrier: Some(clEnqueueBarrier),
|
||||
clGetExtensionFunctionAddress: Some(clGetExtensionFunctionAddress),
|
||||
clCreateFromGLBuffer: Some(clCreateFromGLBuffer),
|
||||
clCreateFromGLTexture2D: Some(clCreateFromGLTexture2D),
|
||||
clCreateFromGLTexture3D: Some(clCreateFromGLTexture3D),
|
||||
clCreateFromGLRenderbuffer: Some(clCreateFromGLRenderbuffer),
|
||||
clGetGLObjectInfo: Some(clGetGLObjectInfo),
|
||||
clGetGLTextureInfo: Some(clGetGLTextureInfo),
|
||||
clEnqueueAcquireGLObjects: Some(clEnqueueAcquireGLObjects),
|
||||
clEnqueueReleaseGLObjects: Some(clEnqueueReleaseGLObjects),
|
||||
clGetGLContextInfoKHR: Some(clGetGLContextInfoKHR),
|
||||
clGetDeviceIDsFromD3D10KHR: ptr::null_mut(),
|
||||
clCreateFromD3D10BufferKHR: ptr::null_mut(),
|
||||
clCreateFromD3D10Texture2DKHR: ptr::null_mut(),
|
||||
clCreateFromD3D10Texture3DKHR: ptr::null_mut(),
|
||||
clEnqueueAcquireD3D10ObjectsKHR: ptr::null_mut(),
|
||||
clEnqueueReleaseD3D10ObjectsKHR: ptr::null_mut(),
|
||||
clSetEventCallback: Some(cl_set_event_callback),
|
||||
clCreateSubBuffer: Some(cl_create_sub_buffer),
|
||||
clSetMemObjectDestructorCallback: Some(cl_set_mem_object_destructor_callback),
|
||||
clCreateUserEvent: Some(cl_create_user_event),
|
||||
clSetUserEventStatus: Some(cl_set_user_event_status),
|
||||
clEnqueueReadBufferRect: Some(cl_enqueue_read_buffer_rect),
|
||||
clEnqueueWriteBufferRect: Some(cl_enqueue_write_buffer_rect),
|
||||
clEnqueueCopyBufferRect: Some(cl_enqueue_copy_buffer_rect),
|
||||
clSetEventCallback: Some(clSetEventCallback),
|
||||
clCreateSubBuffer: Some(clCreateSubBuffer),
|
||||
clSetMemObjectDestructorCallback: Some(clSetMemObjectDestructorCallback),
|
||||
clCreateUserEvent: Some(clCreateUserEvent),
|
||||
clSetUserEventStatus: Some(clSetUserEventStatus),
|
||||
clEnqueueReadBufferRect: Some(clEnqueueReadBufferRect),
|
||||
clEnqueueWriteBufferRect: Some(clEnqueueWriteBufferRect),
|
||||
clEnqueueCopyBufferRect: Some(clEnqueueCopyBufferRect),
|
||||
clCreateSubDevicesEXT: None,
|
||||
clRetainDeviceEXT: None,
|
||||
clReleaseDeviceEXT: None,
|
||||
clCreateEventFromGLsyncKHR: None,
|
||||
clCreateSubDevices: None,
|
||||
clRetainDevice: Some(cl_retain_device),
|
||||
clReleaseDevice: Some(cl_release_device),
|
||||
clCreateImage: Some(cl_create_image),
|
||||
clRetainDevice: Some(clRetainDevice),
|
||||
clReleaseDevice: Some(clReleaseDevice),
|
||||
clCreateImage: Some(clCreateImage),
|
||||
clCreateProgramWithBuiltInKernels: None,
|
||||
clCompileProgram: Some(cl_compile_program),
|
||||
clLinkProgram: Some(cl_link_program),
|
||||
clUnloadPlatformCompiler: Some(cl_unload_platform_compiler),
|
||||
clGetKernelArgInfo: Some(cl_get_kernel_arg_info),
|
||||
clEnqueueFillBuffer: Some(cl_enqueue_fill_buffer),
|
||||
clEnqueueFillImage: Some(cl_enqueue_fill_image),
|
||||
clEnqueueMigrateMemObjects: Some(cl_enqueue_migrate_mem_objects),
|
||||
clEnqueueMarkerWithWaitList: Some(cl_enqueue_marker_with_wait_list),
|
||||
clEnqueueBarrierWithWaitList: Some(cl_enqueue_barrier_with_wait_list),
|
||||
clGetExtensionFunctionAddressForPlatform: Some(cl_get_extension_function_address_for_platform),
|
||||
clCreateFromGLTexture: Some(cl_create_from_gl_texture),
|
||||
clCompileProgram: Some(clCompileProgram),
|
||||
clLinkProgram: Some(clLinkProgram),
|
||||
clUnloadPlatformCompiler: Some(clUnloadPlatformCompiler),
|
||||
clGetKernelArgInfo: Some(clGetKernelArgInfo),
|
||||
clEnqueueFillBuffer: Some(clEnqueueFillBuffer),
|
||||
clEnqueueFillImage: Some(clEnqueueFillImage),
|
||||
clEnqueueMigrateMemObjects: Some(clEnqueueMigrateMemObjects),
|
||||
clEnqueueMarkerWithWaitList: Some(clEnqueueMarkerWithWaitList),
|
||||
clEnqueueBarrierWithWaitList: Some(clEnqueueBarrierWithWaitList),
|
||||
clGetExtensionFunctionAddressForPlatform: Some(clGetExtensionFunctionAddressForPlatform),
|
||||
clCreateFromGLTexture: Some(clCreateFromGLTexture),
|
||||
clGetDeviceIDsFromD3D11KHR: ptr::null_mut(),
|
||||
clCreateFromD3D11BufferKHR: ptr::null_mut(),
|
||||
clCreateFromD3D11Texture2DKHR: ptr::null_mut(),
|
||||
|
|
@ -144,32 +145,32 @@ pub static DISPATCH: cl_icd_dispatch = cl_icd_dispatch {
|
|||
clEnqueueAcquireEGLObjectsKHR: None,
|
||||
clEnqueueReleaseEGLObjectsKHR: None,
|
||||
clCreateEventFromEGLSyncKHR: None,
|
||||
clCreateCommandQueueWithProperties: Some(cl_create_command_queue_with_properties),
|
||||
clCreatePipe: Some(cl_create_pipe),
|
||||
clGetPipeInfo: Some(cl_get_pipe_info),
|
||||
clSVMAlloc: Some(cl_svm_alloc),
|
||||
clSVMFree: Some(cl_svm_free),
|
||||
clEnqueueSVMFree: Some(cl_enqueue_svm_free),
|
||||
clEnqueueSVMMemcpy: Some(cl_enqueue_svm_memcpy),
|
||||
clEnqueueSVMMemFill: Some(cl_enqueue_svm_mem_fill),
|
||||
clEnqueueSVMMap: Some(cl_enqueue_svm_map),
|
||||
clEnqueueSVMUnmap: Some(cl_enqueue_svm_unmap),
|
||||
clCreateSamplerWithProperties: Some(cl_create_sampler_with_properties),
|
||||
clSetKernelArgSVMPointer: Some(cl_set_kernel_arg_svm_pointer),
|
||||
clSetKernelExecInfo: Some(cl_set_kernel_exec_info),
|
||||
clGetKernelSubGroupInfoKHR: Some(cl_get_kernel_sub_group_info),
|
||||
clCloneKernel: Some(cl_clone_kernel),
|
||||
clCreateProgramWithIL: Some(cl_create_program_with_il),
|
||||
clEnqueueSVMMigrateMem: Some(cl_enqueue_svm_migrate_mem),
|
||||
clGetDeviceAndHostTimer: Some(cl_get_device_and_host_timer),
|
||||
clGetHostTimer: Some(cl_get_host_timer),
|
||||
clGetKernelSubGroupInfo: Some(cl_get_kernel_sub_group_info),
|
||||
clSetDefaultDeviceCommandQueue: Some(cl_set_default_device_command_queue),
|
||||
clSetProgramReleaseCallback: Some(cl_set_program_release_callback),
|
||||
clSetProgramSpecializationConstant: Some(cl_set_program_specialization_constant),
|
||||
clCreateBufferWithProperties: Some(cl_create_buffer_with_properties),
|
||||
clCreateImageWithProperties: Some(cl_create_image_with_properties),
|
||||
clSetContextDestructorCallback: Some(cl_set_context_destructor_callback),
|
||||
clCreateCommandQueueWithProperties: Some(clCreateCommandQueueWithProperties),
|
||||
clCreatePipe: Some(clCreatePipe),
|
||||
clGetPipeInfo: Some(clGetPipeInfo),
|
||||
clSVMAlloc: Some(clSVMAlloc),
|
||||
clSVMFree: Some(clSVMFree),
|
||||
clEnqueueSVMFree: Some(clEnqueueSVMFree),
|
||||
clEnqueueSVMMemcpy: Some(clEnqueueSVMMemcpy),
|
||||
clEnqueueSVMMemFill: Some(clEnqueueSVMMemFill),
|
||||
clEnqueueSVMMap: Some(clEnqueueSVMMap),
|
||||
clEnqueueSVMUnmap: Some(clEnqueueSVMUnmap),
|
||||
clCreateSamplerWithProperties: Some(clCreateSamplerWithProperties),
|
||||
clSetKernelArgSVMPointer: Some(clSetKernelArgSVMPointer),
|
||||
clSetKernelExecInfo: Some(clSetKernelExecInfo),
|
||||
clGetKernelSubGroupInfoKHR: Some(clGetKernelSubGroupInfo),
|
||||
clCloneKernel: Some(clCloneKernel),
|
||||
clCreateProgramWithIL: Some(clCreateProgramWithIL),
|
||||
clEnqueueSVMMigrateMem: Some(clEnqueueSVMMigrateMem),
|
||||
clGetDeviceAndHostTimer: Some(clGetDeviceAndHostTimer),
|
||||
clGetHostTimer: Some(clGetHostTimer),
|
||||
clGetKernelSubGroupInfo: Some(clGetKernelSubGroupInfo),
|
||||
clSetDefaultDeviceCommandQueue: Some(clSetDefaultDeviceCommandQueue),
|
||||
clSetProgramReleaseCallback: Some(clSetProgramReleaseCallback),
|
||||
clSetProgramSpecializationConstant: Some(clSetProgramSpecializationConstant),
|
||||
clCreateBufferWithProperties: Some(clCreateBufferWithProperties),
|
||||
clCreateImageWithProperties: Some(clCreateImageWithProperties),
|
||||
clSetContextDestructorCallback: Some(clSetContextDestructorCallback),
|
||||
};
|
||||
|
||||
pub type CLError = cl_int;
|
||||
|
|
@ -447,7 +448,7 @@ extern "C" fn clGetPlatformInfo(
|
|||
param_value: *mut ::std::ffi::c_void,
|
||||
param_value_size_ret: *mut usize,
|
||||
) -> cl_int {
|
||||
cl_get_platform_info(
|
||||
platform::clGetPlatformInfo(
|
||||
platform,
|
||||
param_name,
|
||||
param_value_size,
|
||||
|
|
@ -456,20 +457,13 @@ extern "C" fn clGetPlatformInfo(
|
|||
)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
extern "C" fn clGetExtensionFunctionAddress(
|
||||
function_name: *const ::std::os::raw::c_char,
|
||||
) -> *mut ::std::ffi::c_void {
|
||||
cl_get_extension_function_address(function_name)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
extern "C" fn clIcdGetPlatformIDsKHR(
|
||||
num_entries: cl_uint,
|
||||
platforms: *mut cl_platform_id,
|
||||
num_platforms: *mut cl_uint,
|
||||
) -> cl_int {
|
||||
cl_get_platform_ids(num_entries, platforms, num_platforms)
|
||||
clGetPlatformIDs(num_entries, platforms, num_platforms)
|
||||
}
|
||||
|
||||
macro_rules! cl_ext_func {
|
||||
|
|
@ -480,7 +474,8 @@ macro_rules! cl_ext_func {
|
|||
}
|
||||
|
||||
#[rustfmt::skip]
|
||||
extern "C" fn cl_get_extension_function_address(
|
||||
#[no_mangle]
|
||||
extern "C" fn clGetExtensionFunctionAddress(
|
||||
function_name: *const c_char,
|
||||
) -> *mut c_void {
|
||||
if function_name.is_null() {
|
||||
|
|
@ -488,49 +483,49 @@ extern "C" fn cl_get_extension_function_address(
|
|||
}
|
||||
match unsafe { CStr::from_ptr(function_name) }.to_str().unwrap() {
|
||||
// cl_khr_create_command_queue
|
||||
"clCreateCommandQueueWithPropertiesKHR" => cl_ext_func!(cl_create_command_queue_with_properties: clCreateCommandQueueWithPropertiesKHR_fn),
|
||||
"clCreateCommandQueueWithPropertiesKHR" => cl_ext_func!(clCreateCommandQueueWithProperties: clCreateCommandQueueWithPropertiesKHR_fn),
|
||||
|
||||
// cl_khr_icd
|
||||
"clGetPlatformInfo" => cl_ext_func!(cl_get_platform_info: cl_api_clGetPlatformInfo),
|
||||
"clIcdGetPlatformIDsKHR" => cl_ext_func!(cl_get_platform_ids: clIcdGetPlatformIDsKHR_fn),
|
||||
"clGetPlatformInfo" => cl_ext_func!(clGetPlatformInfo: cl_api_clGetPlatformInfo),
|
||||
"clIcdGetPlatformIDsKHR" => cl_ext_func!(clIcdGetPlatformIDsKHR: clIcdGetPlatformIDsKHR_fn),
|
||||
|
||||
// cl_khr_il_program
|
||||
"clCreateProgramWithILKHR" => cl_ext_func!(cl_create_program_with_il: clCreateProgramWithILKHR_fn),
|
||||
"clCreateProgramWithILKHR" => cl_ext_func!(clCreateProgramWithIL: clCreateProgramWithILKHR_fn),
|
||||
|
||||
// cl_khr_gl_sharing
|
||||
"clCreateFromGLBuffer" => cl_ext_func!(cl_create_from_gl_buffer: cl_api_clCreateFromGLBuffer),
|
||||
"clCreateFromGLRenderbuffer" => cl_ext_func!(cl_create_from_gl_renderbuffer: cl_api_clCreateFromGLRenderbuffer),
|
||||
"clCreateFromGLTexture" => cl_ext_func!(cl_create_from_gl_texture: cl_api_clCreateFromGLTexture),
|
||||
"clCreateFromGLTexture2D" => cl_ext_func!(cl_create_from_gl_texture_2d: cl_api_clCreateFromGLTexture2D),
|
||||
"clCreateFromGLTexture3D" => cl_ext_func!(cl_create_from_gl_texture_3d: cl_api_clCreateFromGLTexture3D),
|
||||
"clEnqueueAcquireGLObjects" => cl_ext_func!(cl_enqueue_acquire_gl_objects: cl_api_clEnqueueAcquireGLObjects),
|
||||
"clEnqueueReleaseGLObjects" => cl_ext_func!(cl_enqueue_release_gl_objects: cl_api_clEnqueueReleaseGLObjects),
|
||||
"clGetGLContextInfoKHR" => cl_ext_func!(cl_get_gl_context_info_khr: cl_api_clGetGLContextInfoKHR),
|
||||
"clGetGLObjectInfo" => cl_ext_func!(cl_get_gl_object_info: cl_api_clGetGLObjectInfo),
|
||||
"clGetGLTextureInfo" => cl_ext_func!(cl_get_gl_texture_info: cl_api_clGetGLTextureInfo),
|
||||
"clCreateFromGLBuffer" => cl_ext_func!(clCreateFromGLBuffer: cl_api_clCreateFromGLBuffer),
|
||||
"clCreateFromGLRenderbuffer" => cl_ext_func!(clCreateFromGLRenderbuffer: cl_api_clCreateFromGLRenderbuffer),
|
||||
"clCreateFromGLTexture" => cl_ext_func!(clCreateFromGLTexture: cl_api_clCreateFromGLTexture),
|
||||
"clCreateFromGLTexture2D" => cl_ext_func!(clCreateFromGLTexture2D: cl_api_clCreateFromGLTexture2D),
|
||||
"clCreateFromGLTexture3D" => cl_ext_func!(clCreateFromGLTexture3D: cl_api_clCreateFromGLTexture3D),
|
||||
"clEnqueueAcquireGLObjects" => cl_ext_func!(clEnqueueAcquireGLObjects: cl_api_clEnqueueAcquireGLObjects),
|
||||
"clEnqueueReleaseGLObjects" => cl_ext_func!(clEnqueueReleaseGLObjects: cl_api_clEnqueueReleaseGLObjects),
|
||||
"clGetGLContextInfoKHR" => cl_ext_func!(clGetGLContextInfoKHR: cl_api_clGetGLContextInfoKHR),
|
||||
"clGetGLObjectInfo" => cl_ext_func!(clGetGLObjectInfo: cl_api_clGetGLObjectInfo),
|
||||
"clGetGLTextureInfo" => cl_ext_func!(clGetGLTextureInfo: cl_api_clGetGLTextureInfo),
|
||||
|
||||
// cl_khr_suggested_local_work_size
|
||||
"clGetKernelSuggestedLocalWorkSizeKHR" => cl_ext_func!(cl_get_kernel_suggested_local_work_size_khr: clGetKernelSuggestedLocalWorkSizeKHR_fn),
|
||||
"clGetKernelSuggestedLocalWorkSizeKHR" => cl_ext_func!(clGetKernelSuggestedLocalWorkSizeKHR: clGetKernelSuggestedLocalWorkSizeKHR_fn),
|
||||
|
||||
// cl_arm_shared_virtual_memory
|
||||
"clEnqueueSVMFreeARM" => cl_ext_func!(cl_enqueue_svm_free_arm: cl_api_clEnqueueSVMFree),
|
||||
"clEnqueueSVMMapARM" => cl_ext_func!(cl_enqueue_svm_map_arm: cl_api_clEnqueueSVMMap),
|
||||
"clEnqueueSVMMemcpyARM" => cl_ext_func!(cl_enqueue_svm_memcpy_arm: cl_api_clEnqueueSVMMemcpy),
|
||||
"clEnqueueSVMMemFillARM" => cl_ext_func!(cl_enqueue_svm_mem_fill_arm: cl_api_clEnqueueSVMMemFill),
|
||||
"clEnqueueSVMUnmapARM" => cl_ext_func!(cl_enqueue_svm_unmap_arm: cl_api_clEnqueueSVMUnmap),
|
||||
"clSetKernelArgSVMPointerARM" => cl_ext_func!(cl_set_kernel_arg_svm_pointer: cl_api_clSetKernelArgSVMPointer),
|
||||
"clSetKernelExecInfoARM" => cl_ext_func!(cl_set_kernel_exec_info: cl_api_clSetKernelExecInfo),
|
||||
"clSVMAllocARM" => cl_ext_func!(cl_svm_alloc: cl_api_clSVMAlloc),
|
||||
"clSVMFreeARM" => cl_ext_func!(cl_svm_free: cl_api_clSVMFree),
|
||||
"clEnqueueSVMFreeARM" => cl_ext_func!(clEnqueueSVMFreeARM: cl_api_clEnqueueSVMFree),
|
||||
"clEnqueueSVMMapARM" => cl_ext_func!(clEnqueueSVMMapARM: cl_api_clEnqueueSVMMap),
|
||||
"clEnqueueSVMMemcpyARM" => cl_ext_func!(clEnqueueSVMMemcpyARM: cl_api_clEnqueueSVMMemcpy),
|
||||
"clEnqueueSVMMemFillARM" => cl_ext_func!(clEnqueueSVMMemFillARM: cl_api_clEnqueueSVMMemFill),
|
||||
"clEnqueueSVMUnmapARM" => cl_ext_func!(clEnqueueSVMUnmapARM: cl_api_clEnqueueSVMUnmap),
|
||||
"clSetKernelArgSVMPointerARM" => cl_ext_func!(clSetKernelArgSVMPointer: cl_api_clSetKernelArgSVMPointer),
|
||||
"clSetKernelExecInfoARM" => cl_ext_func!(clSetKernelExecInfo: cl_api_clSetKernelExecInfo),
|
||||
"clSVMAllocARM" => cl_ext_func!(clSVMAlloc: cl_api_clSVMAlloc),
|
||||
"clSVMFreeARM" => cl_ext_func!(clSVMFree: cl_api_clSVMFree),
|
||||
|
||||
// DPCPP bug https://github.com/intel/llvm/issues/9964
|
||||
"clSetProgramSpecializationConstant" => cl_ext_func!(cl_set_program_specialization_constant: cl_api_clSetProgramSpecializationConstant),
|
||||
"clSetProgramSpecializationConstant" => cl_ext_func!(clSetProgramSpecializationConstant: cl_api_clSetProgramSpecializationConstant),
|
||||
|
||||
_ => ptr::null_mut(),
|
||||
}
|
||||
}
|
||||
|
||||
extern "C" fn cl_link_program(
|
||||
extern "C" fn clLinkProgram(
|
||||
context: cl_context,
|
||||
num_devices: cl_uint,
|
||||
device_list: *const cl_device_id,
|
||||
|
|
@ -559,14 +554,14 @@ extern "C" fn cl_link_program(
|
|||
ptr
|
||||
}
|
||||
|
||||
extern "C" fn cl_get_extension_function_address_for_platform(
|
||||
extern "C" fn clGetExtensionFunctionAddressForPlatform(
|
||||
_platform: cl_platform_id,
|
||||
function_name: *const ::std::os::raw::c_char,
|
||||
) -> *mut ::std::os::raw::c_void {
|
||||
cl_get_extension_function_address(function_name)
|
||||
clGetExtensionFunctionAddress(function_name)
|
||||
}
|
||||
|
||||
extern "C" fn cl_svm_alloc(
|
||||
extern "C" fn clSVMAlloc(
|
||||
context: cl_context,
|
||||
flags: cl_svm_mem_flags,
|
||||
size: usize,
|
||||
|
|
@ -575,11 +570,11 @@ extern "C" fn cl_svm_alloc(
|
|||
svm_alloc(context, flags, size, alignment).unwrap_or(ptr::null_mut())
|
||||
}
|
||||
|
||||
extern "C" fn cl_svm_free(context: cl_context, svm_pointer: *mut ::std::os::raw::c_void) {
|
||||
extern "C" fn clSVMFree(context: cl_context, svm_pointer: *mut ::std::os::raw::c_void) {
|
||||
svm_free(context, svm_pointer as usize).ok();
|
||||
}
|
||||
|
||||
extern "C" fn cl_get_kernel_sub_group_info(
|
||||
extern "C" fn clGetKernelSubGroupInfo(
|
||||
kernel: cl_kernel,
|
||||
device: cl_device_id,
|
||||
param_name: cl_kernel_sub_group_info,
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ use std::ptr;
|
|||
use std::slice;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[cl_info_entrypoint(cl_get_kernel_info)]
|
||||
#[cl_info_entrypoint(clGetKernelInfo)]
|
||||
impl CLInfo<cl_kernel_info> for cl_kernel {
|
||||
fn query(&self, q: cl_kernel_info, _: &[u8]) -> CLResult<Vec<MaybeUninit<u8>>> {
|
||||
let kernel = Kernel::ref_from_raw(*self)?;
|
||||
|
|
@ -44,7 +44,7 @@ impl CLInfo<cl_kernel_info> for cl_kernel {
|
|||
}
|
||||
}
|
||||
|
||||
#[cl_info_entrypoint(cl_get_kernel_arg_info)]
|
||||
#[cl_info_entrypoint(clGetKernelArgInfo)]
|
||||
impl CLInfoObj<cl_kernel_arg_info, cl_uint> for cl_kernel {
|
||||
fn query(&self, idx: cl_uint, q: cl_kernel_arg_info) -> CLResult<Vec<MaybeUninit<u8>>> {
|
||||
let kernel = Kernel::ref_from_raw(*self)?;
|
||||
|
|
@ -72,7 +72,7 @@ impl CLInfoObj<cl_kernel_arg_info, cl_uint> for cl_kernel {
|
|||
}
|
||||
}
|
||||
|
||||
#[cl_info_entrypoint(cl_get_kernel_work_group_info)]
|
||||
#[cl_info_entrypoint(clGetKernelWorkGroupInfo)]
|
||||
impl CLInfoObj<cl_kernel_work_group_info, cl_device_id> for cl_kernel {
|
||||
fn query(
|
||||
&self,
|
||||
|
|
@ -247,7 +247,7 @@ unsafe fn kernel_work_arr_mut<'a>(arr: *mut usize, work_dim: cl_uint) -> Option<
|
|||
}
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCreateKernel)]
|
||||
fn create_kernel(
|
||||
program: cl_program,
|
||||
kernel_name: *const ::std::os::raw::c_char,
|
||||
|
|
@ -281,17 +281,17 @@ fn create_kernel(
|
|||
Ok(Kernel::new(name, Arc::clone(&p), &build).into_cl())
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clRetainKernel)]
|
||||
fn retain_kernel(kernel: cl_kernel) -> CLResult<()> {
|
||||
Kernel::retain(kernel)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clReleaseKernel)]
|
||||
fn release_kernel(kernel: cl_kernel) -> CLResult<()> {
|
||||
Kernel::release(kernel)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCreateKernelsInProgram)]
|
||||
fn create_kernels_in_program(
|
||||
program: cl_program,
|
||||
num_kernels: cl_uint,
|
||||
|
|
@ -336,7 +336,7 @@ fn create_kernels_in_program(
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clSetKernelArg)]
|
||||
fn set_kernel_arg(
|
||||
kernel: cl_kernel,
|
||||
arg_index: cl_uint,
|
||||
|
|
@ -432,7 +432,7 @@ fn set_kernel_arg(
|
|||
//• CL_MAX_SIZE_RESTRICTION_EXCEEDED if the size in bytes of the memory object (if the argument is a memory object) or arg_size (if the argument is declared with local qualifier) exceeds a language- specified maximum size restriction for this argument, such as the MaxByteOffset SPIR-V decoration. This error code is missing before version 2.2.
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clSetKernelArgSVMPointer)]
|
||||
fn set_kernel_arg_svm_pointer(
|
||||
kernel: cl_kernel,
|
||||
arg_index: cl_uint,
|
||||
|
|
@ -463,7 +463,7 @@ fn set_kernel_arg_svm_pointer(
|
|||
// CL_INVALID_ARG_VALUE if arg_value specified is not a valid value.
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clSetKernelExecInfo)]
|
||||
fn set_kernel_exec_info(
|
||||
kernel: cl_kernel,
|
||||
param_name: cl_kernel_exec_info,
|
||||
|
|
@ -505,7 +505,7 @@ fn set_kernel_exec_info(
|
|||
// CL_INVALID_OPERATION if param_name is CL_KERNEL_EXEC_INFO_SVM_FINE_GRAIN_SYSTEM and param_value is CL_TRUE but no devices in context associated with kernel support fine-grain system SVM allocations.
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueNDRangeKernel)]
|
||||
fn enqueue_ndrange_kernel(
|
||||
command_queue: cl_command_queue,
|
||||
kernel: cl_kernel,
|
||||
|
|
@ -633,7 +633,7 @@ fn enqueue_ndrange_kernel(
|
|||
//• CL_INVALID_OPERATION if SVM pointers are passed as arguments to a kernel and the device does not support SVM or if system pointers are passed as arguments to a kernel and/or stored inside SVM allocations passed as kernel arguments and the device does not support fine grain system SVM allocations.
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueTask)]
|
||||
fn enqueue_task(
|
||||
command_queue: cl_command_queue,
|
||||
kernel: cl_kernel,
|
||||
|
|
@ -657,13 +657,13 @@ fn enqueue_task(
|
|||
)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCloneKernel)]
|
||||
fn clone_kernel(source_kernel: cl_kernel) -> CLResult<cl_kernel> {
|
||||
let k = Kernel::ref_from_raw(source_kernel)?;
|
||||
Ok(Arc::new(k.clone()).into_cl())
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clGetKernelSuggestedLocalWorkSizeKHR)]
|
||||
fn get_kernel_suggested_local_work_size_khr(
|
||||
command_queue: cl_command_queue,
|
||||
kernel: cl_kernel,
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ fn validate_matching_buffer_flags(mem: &MemBase, flags: cl_mem_flags) -> CLResul
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[cl_info_entrypoint(cl_get_mem_object_info)]
|
||||
#[cl_info_entrypoint(clGetMemObjectInfo)]
|
||||
impl CLInfo<cl_mem_info> for cl_mem {
|
||||
fn query(&self, q: cl_mem_info, _: &[u8]) -> CLResult<Vec<MaybeUninit<u8>>> {
|
||||
let mem = MemBase::ref_from_raw(*self)?;
|
||||
|
|
@ -257,7 +257,7 @@ impl CLInfo<cl_mem_info> for cl_mem {
|
|||
}
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCreateBufferWithProperties)]
|
||||
fn create_buffer_with_properties(
|
||||
context: cl_context,
|
||||
properties: *const cl_mem_properties,
|
||||
|
|
@ -307,7 +307,7 @@ fn create_buffer_with_properties(
|
|||
Ok(MemBase::new_buffer(c, flags, size, host_ptr, props)?.into_cl())
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCreateBuffer)]
|
||||
fn create_buffer(
|
||||
context: cl_context,
|
||||
flags: cl_mem_flags,
|
||||
|
|
@ -317,7 +317,7 @@ fn create_buffer(
|
|||
create_buffer_with_properties(context, ptr::null(), flags, size, host_ptr)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCreateSubBuffer)]
|
||||
fn create_sub_buffer(
|
||||
buffer: cl_mem,
|
||||
mut flags: cl_mem_flags,
|
||||
|
|
@ -369,7 +369,7 @@ fn create_sub_buffer(
|
|||
// CL_MISALIGNED_SUB_BUFFER_OFFSET if there are no devices in context associated with buffer for which the origin field of the cl_buffer_region structure passed in buffer_create_info is aligned to the CL_DEVICE_MEM_BASE_ADDR_ALIGN value.
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clSetMemObjectDestructorCallback)]
|
||||
fn set_mem_object_destructor_callback(
|
||||
memobj: cl_mem,
|
||||
pfn_notify: Option<FuncMemCB>,
|
||||
|
|
@ -720,7 +720,7 @@ fn validate_buffer(
|
|||
Ok(flags)
|
||||
}
|
||||
|
||||
#[cl_info_entrypoint(cl_get_image_info)]
|
||||
#[cl_info_entrypoint(clGetImageInfo)]
|
||||
impl CLInfo<cl_image_info> for cl_mem {
|
||||
fn query(&self, q: cl_image_info, _: &[u8]) -> CLResult<Vec<MaybeUninit<u8>>> {
|
||||
let mem = Image::ref_from_raw(*self)?;
|
||||
|
|
@ -745,7 +745,7 @@ impl CLInfo<cl_image_info> for cl_mem {
|
|||
}
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCreateImageWithProperties)]
|
||||
fn create_image_with_properties(
|
||||
context: cl_context,
|
||||
properties: *const cl_mem_properties,
|
||||
|
|
@ -811,7 +811,7 @@ fn create_image_with_properties(
|
|||
.into_cl())
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCreateImage)]
|
||||
fn create_image(
|
||||
context: cl_context,
|
||||
flags: cl_mem_flags,
|
||||
|
|
@ -829,7 +829,7 @@ fn create_image(
|
|||
)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCreateImage2D)]
|
||||
fn create_image_2d(
|
||||
context: cl_context,
|
||||
flags: cl_mem_flags,
|
||||
|
|
@ -850,7 +850,7 @@ fn create_image_2d(
|
|||
create_image(context, flags, image_format, &image_desc, host_ptr)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCreateImage3D)]
|
||||
fn create_image_3d(
|
||||
context: cl_context,
|
||||
flags: cl_mem_flags,
|
||||
|
|
@ -875,7 +875,7 @@ fn create_image_3d(
|
|||
create_image(context, flags, image_format, &image_desc, host_ptr)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clGetSupportedImageFormats)]
|
||||
fn get_supported_image_formats(
|
||||
context: cl_context,
|
||||
flags: cl_mem_flags,
|
||||
|
|
@ -920,7 +920,7 @@ fn get_supported_image_formats(
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[cl_info_entrypoint(cl_get_sampler_info)]
|
||||
#[cl_info_entrypoint(clGetSamplerInfo)]
|
||||
impl CLInfo<cl_sampler_info> for cl_sampler {
|
||||
fn query(&self, q: cl_sampler_info, _: &[u8]) -> CLResult<Vec<MaybeUninit<u8>>> {
|
||||
let sampler = Sampler::ref_from_raw(*self)?;
|
||||
|
|
@ -974,7 +974,7 @@ fn create_sampler_impl(
|
|||
Ok(sampler.into_cl())
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCreateSampler)]
|
||||
fn create_sampler(
|
||||
context: cl_context,
|
||||
normalized_coords: cl_bool,
|
||||
|
|
@ -990,7 +990,7 @@ fn create_sampler(
|
|||
)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCreateSamplerWithProperties)]
|
||||
fn create_sampler_with_properties(
|
||||
context: cl_context,
|
||||
sampler_properties: *const cl_sampler_properties,
|
||||
|
|
@ -1027,17 +1027,17 @@ fn create_sampler_with_properties(
|
|||
)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clRetainSampler)]
|
||||
fn retain_sampler(sampler: cl_sampler) -> CLResult<()> {
|
||||
Sampler::retain(sampler)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clReleaseSampler)]
|
||||
fn release_sampler(sampler: cl_sampler) -> CLResult<()> {
|
||||
Sampler::release(sampler)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueReadBuffer)]
|
||||
fn enqueue_read_buffer(
|
||||
command_queue: cl_command_queue,
|
||||
buffer: cl_mem,
|
||||
|
|
@ -1092,7 +1092,7 @@ fn enqueue_read_buffer(
|
|||
// CL_MISALIGNED_SUB_BUFFER_OFFSET if buffer is a sub-buffer object and offset specified when the sub-buffer object is created is not aligned to CL_DEVICE_MEM_BASE_ADDR_ALIGN value for device associated with queue.
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueWriteBuffer)]
|
||||
fn enqueue_write_buffer(
|
||||
command_queue: cl_command_queue,
|
||||
buffer: cl_mem,
|
||||
|
|
@ -1147,7 +1147,7 @@ fn enqueue_write_buffer(
|
|||
// CL_MISALIGNED_SUB_BUFFER_OFFSET if buffer is a sub-buffer object and offset specified when the sub-buffer object is created is not aligned to CL_DEVICE_MEM_BASE_ADDR_ALIGN value for device associated with queue.
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueCopyBuffer)]
|
||||
fn enqueue_copy_buffer(
|
||||
command_queue: cl_command_queue,
|
||||
src_buffer: cl_mem,
|
||||
|
|
@ -1206,7 +1206,7 @@ fn enqueue_copy_buffer(
|
|||
//• CL_MEM_OBJECT_ALLOCATION_FAILURE if there is a failure to allocate memory for data store associated with src_buffer or dst_buffer.
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueReadBufferRect)]
|
||||
fn enqueue_read_buffer_rect(
|
||||
command_queue: cl_command_queue,
|
||||
buffer: cl_mem,
|
||||
|
|
@ -1331,7 +1331,7 @@ fn enqueue_read_buffer_rect(
|
|||
// CL_MISALIGNED_SUB_BUFFER_OFFSET if buffer is a sub-buffer object and offset specified when the sub-buffer object is created is not aligned to CL_DEVICE_MEM_BASE_ADDR_ALIGN value for device associated with queue.
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueWriteBufferRect)]
|
||||
fn enqueue_write_buffer_rect(
|
||||
command_queue: cl_command_queue,
|
||||
buffer: cl_mem,
|
||||
|
|
@ -1456,7 +1456,7 @@ fn enqueue_write_buffer_rect(
|
|||
// CL_MISALIGNED_SUB_BUFFER_OFFSET if buffer is a sub-buffer object and offset specified when the sub-buffer object is created is not aligned to CL_DEVICE_MEM_BASE_ADDR_ALIGN value for device associated with queue.
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueCopyBufferRect)]
|
||||
fn enqueue_copy_buffer_rect(
|
||||
command_queue: cl_command_queue,
|
||||
src_buffer: cl_mem,
|
||||
|
|
@ -1595,7 +1595,7 @@ fn enqueue_copy_buffer_rect(
|
|||
// CL_MISALIGNED_SUB_BUFFER_OFFSET if src_buffer is a sub-buffer object and offset specified when the sub-buffer object is created is not aligned to CL_DEVICE_MEM_BASE_ADDR_ALIGN value for device associated with queue.
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueFillBuffer)]
|
||||
fn enqueue_fill_buffer(
|
||||
command_queue: cl_command_queue,
|
||||
buffer: cl_mem,
|
||||
|
|
@ -1649,7 +1649,7 @@ fn enqueue_fill_buffer(
|
|||
//• CL_MEM_OBJECT_ALLOCATION_FAILURE if there is a failure to allocate memory for data store associated with buffer.
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueMapBuffer)]
|
||||
fn enqueue_map_buffer(
|
||||
command_queue: cl_command_queue,
|
||||
buffer: cl_mem,
|
||||
|
|
@ -1703,7 +1703,7 @@ fn enqueue_map_buffer(
|
|||
// CL_INVALID_OPERATION if mapping would lead to overlapping regions being mapped for writing.
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueReadImage)]
|
||||
fn enqueue_read_image(
|
||||
command_queue: cl_command_queue,
|
||||
image: cl_mem,
|
||||
|
|
@ -1783,7 +1783,7 @@ fn enqueue_read_image(
|
|||
//• CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST if the read and write operations are blocking and the execution status of any of the events in event_wait_list is a negative integer value.
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueWriteImage)]
|
||||
fn enqueue_write_image(
|
||||
command_queue: cl_command_queue,
|
||||
image: cl_mem,
|
||||
|
|
@ -1863,7 +1863,7 @@ fn enqueue_write_image(
|
|||
//• CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST if the read and write operations are blocking and the execution status of any of the events in event_wait_list is a negative integer value.
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueCopyImage)]
|
||||
fn enqueue_copy_image(
|
||||
command_queue: cl_command_queue,
|
||||
src_image: cl_mem,
|
||||
|
|
@ -1924,7 +1924,7 @@ fn enqueue_copy_image(
|
|||
//• CL_MEM_COPY_OVERLAP if src_image and dst_image are the same image object and the source and destination regions overlap.
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueFillImage)]
|
||||
fn enqueue_fill_image(
|
||||
command_queue: cl_command_queue,
|
||||
image: cl_mem,
|
||||
|
|
@ -1976,7 +1976,7 @@ fn enqueue_fill_image(
|
|||
//image are not supported by device associated with queue.
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueCopyBufferToImage)]
|
||||
fn enqueue_copy_buffer_to_image(
|
||||
command_queue: cl_command_queue,
|
||||
src_buffer: cl_mem,
|
||||
|
|
@ -2031,7 +2031,7 @@ fn enqueue_copy_buffer_to_image(
|
|||
//• CL_INVALID_OPERATION if the device associated with command_queue does not support images (i.e. CL_DEVICE_IMAGE_SUPPORT specified in the Device Queries table is CL_FALSE).
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueCopyImageToBuffer)]
|
||||
fn enqueue_copy_image_to_buffer(
|
||||
command_queue: cl_command_queue,
|
||||
src_image: cl_mem,
|
||||
|
|
@ -2087,7 +2087,7 @@ fn enqueue_copy_image_to_buffer(
|
|||
//• CL_INVALID_OPERATION if the device associated with command_queue does not support images (i.e. CL_DEVICE_IMAGE_SUPPORT specified in the Device Queries table is CL_FALSE).
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueMapImage)]
|
||||
fn enqueue_map_image(
|
||||
command_queue: cl_command_queue,
|
||||
image: cl_mem,
|
||||
|
|
@ -2168,7 +2168,7 @@ fn enqueue_map_image(
|
|||
//• CL_INVALID_OPERATION if mapping would lead to overlapping regions being mapped for writing.
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clRetainMemObject)]
|
||||
fn retain_mem_object(mem: cl_mem) -> CLResult<()> {
|
||||
let m = MemBase::ref_from_raw(mem)?;
|
||||
match m.base.get_type()? {
|
||||
|
|
@ -2178,7 +2178,7 @@ fn retain_mem_object(mem: cl_mem) -> CLResult<()> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clReleaseMemObject)]
|
||||
fn release_mem_object(mem: cl_mem) -> CLResult<()> {
|
||||
let m = MemBase::ref_from_raw(mem)?;
|
||||
match m.base.get_type()? {
|
||||
|
|
@ -2188,7 +2188,7 @@ fn release_mem_object(mem: cl_mem) -> CLResult<()> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueUnmapMemObject)]
|
||||
fn enqueue_unmap_mem_object(
|
||||
command_queue: cl_command_queue,
|
||||
memobj: cl_mem,
|
||||
|
|
@ -2224,7 +2224,7 @@ fn enqueue_unmap_mem_object(
|
|||
)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueMigrateMemObjects)]
|
||||
fn enqueue_migrate_mem_objects(
|
||||
command_queue: cl_command_queue,
|
||||
num_mem_objects: cl_uint,
|
||||
|
|
@ -2272,7 +2272,7 @@ fn enqueue_migrate_mem_objects(
|
|||
//• CL_MEM_OBJECT_ALLOCATION_FAILURE if there is a failure to allocate memory for the specified set of memory objects in mem_objects.
|
||||
}
|
||||
|
||||
#[cl_info_entrypoint(cl_get_pipe_info)]
|
||||
#[cl_info_entrypoint(clGetPipeInfo)]
|
||||
impl CLInfo<cl_pipe_info> for cl_mem {
|
||||
fn query(&self, _q: cl_pipe_info, _: &[u8]) -> CLResult<Vec<MaybeUninit<u8>>> {
|
||||
// CL_INVALID_MEM_OBJECT if pipe is a not a valid pipe object.
|
||||
|
|
@ -2411,7 +2411,7 @@ fn enqueue_svm_free_impl(
|
|||
)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueSVMFree)]
|
||||
fn enqueue_svm_free(
|
||||
command_queue: cl_command_queue,
|
||||
num_svm_pointers: cl_uint,
|
||||
|
|
@ -2435,7 +2435,7 @@ fn enqueue_svm_free(
|
|||
)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueSVMFreeARM)]
|
||||
fn enqueue_svm_free_arm(
|
||||
command_queue: cl_command_queue,
|
||||
num_svm_pointers: cl_uint,
|
||||
|
|
@ -2519,7 +2519,7 @@ fn enqueue_svm_memcpy_impl(
|
|||
)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueSVMMemcpy)]
|
||||
fn enqueue_svm_memcpy(
|
||||
command_queue: cl_command_queue,
|
||||
blocking_copy: cl_bool,
|
||||
|
|
@ -2543,7 +2543,7 @@ fn enqueue_svm_memcpy(
|
|||
)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueSVMMemcpyARM)]
|
||||
fn enqueue_svm_memcpy_arm(
|
||||
command_queue: cl_command_queue,
|
||||
blocking_copy: cl_bool,
|
||||
|
|
@ -2699,7 +2699,7 @@ fn enqueue_svm_mem_fill_impl(
|
|||
create_and_queue(q, cmd_type, evs, event, false, work)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueSVMMemFill)]
|
||||
fn enqueue_svm_mem_fill(
|
||||
command_queue: cl_command_queue,
|
||||
svm_ptr: *mut ::std::os::raw::c_void,
|
||||
|
|
@ -2723,7 +2723,7 @@ fn enqueue_svm_mem_fill(
|
|||
)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueSVMMemFillARM)]
|
||||
fn enqueue_svm_mem_fill_arm(
|
||||
command_queue: cl_command_queue,
|
||||
svm_ptr: *mut ::std::os::raw::c_void,
|
||||
|
|
@ -2783,7 +2783,7 @@ fn enqueue_svm_map_impl(
|
|||
create_and_queue(q, cmd_type, evs, event, block, Box::new(|_, _| Ok(())))
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueSVMMap)]
|
||||
fn enqueue_svm_map(
|
||||
command_queue: cl_command_queue,
|
||||
blocking_map: cl_bool,
|
||||
|
|
@ -2807,7 +2807,7 @@ fn enqueue_svm_map(
|
|||
)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueSVMMapARM)]
|
||||
fn enqueue_svm_map_arm(
|
||||
command_queue: cl_command_queue,
|
||||
blocking_map: cl_bool,
|
||||
|
|
@ -2855,7 +2855,7 @@ fn enqueue_svm_unmap_impl(
|
|||
create_and_queue(q, cmd_type, evs, event, false, Box::new(|_, _| Ok(())))
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueSVMUnmap)]
|
||||
fn enqueue_svm_unmap(
|
||||
command_queue: cl_command_queue,
|
||||
svm_ptr: *mut ::std::os::raw::c_void,
|
||||
|
|
@ -2873,7 +2873,7 @@ fn enqueue_svm_unmap(
|
|||
)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueSVMUnmapARM)]
|
||||
fn enqueue_svm_unmap_arm(
|
||||
command_queue: cl_command_queue,
|
||||
svm_ptr: *mut ::std::os::raw::c_void,
|
||||
|
|
@ -2891,7 +2891,7 @@ fn enqueue_svm_unmap_arm(
|
|||
)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueSVMMigrateMem)]
|
||||
fn enqueue_svm_migrate_mem(
|
||||
command_queue: cl_command_queue,
|
||||
num_svm_pointers: cl_uint,
|
||||
|
|
@ -2963,7 +2963,7 @@ fn enqueue_svm_migrate_mem(
|
|||
)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCreatePipe)]
|
||||
fn create_pipe(
|
||||
_context: cl_context,
|
||||
_flags: cl_mem_flags,
|
||||
|
|
@ -2974,7 +2974,7 @@ fn create_pipe(
|
|||
Err(CL_INVALID_OPERATION)
|
||||
}
|
||||
|
||||
#[cl_info_entrypoint(cl_get_gl_texture_info)]
|
||||
#[cl_info_entrypoint(clGetGLTextureInfo)]
|
||||
impl CLInfo<cl_gl_texture_info> for cl_mem {
|
||||
fn query(&self, q: cl_gl_texture_info, _: &[u8]) -> CLResult<Vec<MaybeUninit<u8>>> {
|
||||
let mem = MemBase::ref_from_raw(*self)?;
|
||||
|
|
@ -3027,7 +3027,7 @@ fn create_from_gl(
|
|||
}
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCreateFromGLTexture)]
|
||||
fn create_from_gl_texture(
|
||||
context: cl_context,
|
||||
flags: cl_mem_flags,
|
||||
|
|
@ -3044,7 +3044,7 @@ fn create_from_gl_texture(
|
|||
create_from_gl(context, flags, target, miplevel, texture)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCreateFromGLTexture2D)]
|
||||
fn create_from_gl_texture_2d(
|
||||
context: cl_context,
|
||||
flags: cl_mem_flags,
|
||||
|
|
@ -3061,7 +3061,7 @@ fn create_from_gl_texture_2d(
|
|||
create_from_gl(context, flags, target, miplevel, texture)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCreateFromGLTexture3D)]
|
||||
fn create_from_gl_texture_3d(
|
||||
context: cl_context,
|
||||
flags: cl_mem_flags,
|
||||
|
|
@ -3078,7 +3078,7 @@ fn create_from_gl_texture_3d(
|
|||
create_from_gl(context, flags, target, miplevel, texture)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCreateFromGLBuffer)]
|
||||
fn create_from_gl_buffer(
|
||||
context: cl_context,
|
||||
flags: cl_mem_flags,
|
||||
|
|
@ -3087,7 +3087,7 @@ fn create_from_gl_buffer(
|
|||
create_from_gl(context, flags, GL_ARRAY_BUFFER, 0, bufobj)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCreateFromGLRenderbuffer)]
|
||||
fn create_from_gl_renderbuffer(
|
||||
context: cl_context,
|
||||
flags: cl_mem_flags,
|
||||
|
|
@ -3096,7 +3096,7 @@ fn create_from_gl_renderbuffer(
|
|||
create_from_gl(context, flags, GL_RENDERBUFFER, 0, renderbuffer)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clGetGLObjectInfo)]
|
||||
fn get_gl_object_info(
|
||||
memobj: cl_mem,
|
||||
gl_object_type: *mut cl_gl_object_type,
|
||||
|
|
@ -3118,7 +3118,7 @@ fn get_gl_object_info(
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueAcquireGLObjects)]
|
||||
fn enqueue_acquire_gl_objects(
|
||||
command_queue: cl_command_queue,
|
||||
num_objects: cl_uint,
|
||||
|
|
@ -3152,7 +3152,7 @@ fn enqueue_acquire_gl_objects(
|
|||
)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueReleaseGLObjects)]
|
||||
fn enqueue_release_gl_objects(
|
||||
command_queue: cl_command_queue,
|
||||
num_objects: cl_uint,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ use rusticl_proc_macros::cl_info_entrypoint;
|
|||
|
||||
use std::mem::MaybeUninit;
|
||||
|
||||
#[cl_info_entrypoint(cl_get_platform_info)]
|
||||
#[cl_info_entrypoint(clGetPlatformInfo)]
|
||||
impl CLInfo<cl_platform_info> for cl_platform_id {
|
||||
fn query(&self, q: cl_platform_info, _: &[u8]) -> CLResult<Vec<MaybeUninit<u8>>> {
|
||||
self.get_ref()?;
|
||||
|
|
@ -34,7 +34,7 @@ impl CLInfo<cl_platform_info> for cl_platform_id {
|
|||
}
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clGetPlatformIDs)]
|
||||
fn get_platform_ids(
|
||||
num_entries: cl_uint,
|
||||
platforms: *mut cl_platform_id,
|
||||
|
|
@ -67,7 +67,7 @@ fn get_platform_ids(
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clUnloadPlatformCompiler)]
|
||||
fn unload_platform_compiler(platform: cl_platform_id) -> CLResult<()> {
|
||||
platform.get_ref()?;
|
||||
// TODO unload the compiler
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ use std::ptr;
|
|||
use std::slice;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[cl_info_entrypoint(cl_get_program_info)]
|
||||
#[cl_info_entrypoint(clGetProgramInfo)]
|
||||
impl CLInfo<cl_program_info> for cl_program {
|
||||
fn query(&self, q: cl_program_info, vals: &[u8]) -> CLResult<Vec<MaybeUninit<u8>>> {
|
||||
let prog = Program::ref_from_raw(*self)?;
|
||||
|
|
@ -60,7 +60,7 @@ impl CLInfo<cl_program_info> for cl_program {
|
|||
}
|
||||
}
|
||||
|
||||
#[cl_info_entrypoint(cl_get_program_build_info)]
|
||||
#[cl_info_entrypoint(clGetProgramBuildInfo)]
|
||||
impl CLInfoObj<cl_program_build_info, cl_device_id> for cl_program {
|
||||
fn query(&self, d: cl_device_id, q: cl_program_build_info) -> CLResult<Vec<MaybeUninit<u8>>> {
|
||||
let prog = Program::ref_from_raw(*self)?;
|
||||
|
|
@ -93,7 +93,7 @@ fn validate_devices<'a>(
|
|||
Ok(devs)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCreateProgramWithSource)]
|
||||
fn create_program_with_source(
|
||||
context: cl_context,
|
||||
count: cl_uint,
|
||||
|
|
@ -172,7 +172,7 @@ fn create_program_with_source(
|
|||
.into_cl())
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCreateProgramWithBinary)]
|
||||
fn create_program_with_binary(
|
||||
context: cl_context,
|
||||
num_devices: cl_uint,
|
||||
|
|
@ -233,7 +233,7 @@ fn create_program_with_binary(
|
|||
//• CL_INVALID_BINARY if an invalid program binary was encountered for any device. binary_status will return specific status for each device.
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCreateProgramWithIL)]
|
||||
fn create_program_with_il(
|
||||
context: cl_context,
|
||||
il: *const ::std::os::raw::c_void,
|
||||
|
|
@ -251,12 +251,12 @@ fn create_program_with_il(
|
|||
Ok(Program::from_spirv(c, spirv).into_cl())
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clRetainProgram)]
|
||||
fn retain_program(program: cl_program) -> CLResult<()> {
|
||||
Program::retain(program)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clReleaseProgram)]
|
||||
fn release_program(program: cl_program) -> CLResult<()> {
|
||||
Program::release(program)
|
||||
}
|
||||
|
|
@ -272,7 +272,7 @@ fn debug_logging(p: &Program, devs: &[&Device]) {
|
|||
}
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clBuildProgram)]
|
||||
fn build_program(
|
||||
program: cl_program,
|
||||
num_devices: cl_uint,
|
||||
|
|
@ -317,7 +317,7 @@ fn build_program(
|
|||
}
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCompileProgram)]
|
||||
fn compile_program(
|
||||
program: cl_program,
|
||||
num_devices: cl_uint,
|
||||
|
|
@ -462,7 +462,7 @@ pub fn link_program(
|
|||
//• CL_INVALID_OPERATION if the rules for devices containing compiled binaries or libraries as described in input_programs argument above are not followed.
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clSetProgramSpecializationConstant)]
|
||||
fn set_program_specialization_constant(
|
||||
program: cl_program,
|
||||
spec_id: cl_uint,
|
||||
|
|
@ -497,7 +497,7 @@ fn set_program_specialization_constant(
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clSetProgramReleaseCallback)]
|
||||
fn set_program_release_callback(
|
||||
_program: cl_program,
|
||||
_pfn_notify: ::std::option::Option<FuncProgramCB>,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ use std::mem::MaybeUninit;
|
|||
use std::ptr;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[cl_info_entrypoint(cl_get_command_queue_info)]
|
||||
#[cl_info_entrypoint(clGetCommandQueueInfo)]
|
||||
impl CLInfo<cl_command_queue_info> for cl_command_queue {
|
||||
fn query(&self, q: cl_command_queue_info, _: &[u8]) -> CLResult<Vec<MaybeUninit<u8>>> {
|
||||
let queue = Queue::ref_from_raw(*self)?;
|
||||
|
|
@ -97,7 +97,7 @@ pub fn create_command_queue_impl(
|
|||
Ok(Queue::new(c, d, properties, properties_v2)?.into_cl())
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCreateCommandQueue)]
|
||||
fn create_command_queue(
|
||||
context: cl_context,
|
||||
device: cl_device_id,
|
||||
|
|
@ -106,7 +106,7 @@ fn create_command_queue(
|
|||
create_command_queue_impl(context, device, properties, None)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clCreateCommandQueueWithProperties)]
|
||||
fn create_command_queue_with_properties(
|
||||
context: cl_context,
|
||||
device: cl_device_id,
|
||||
|
|
@ -134,7 +134,7 @@ fn create_command_queue_with_properties(
|
|||
create_command_queue_impl(context, device, queue_properties, properties)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueMarker)]
|
||||
fn enqueue_marker(command_queue: cl_command_queue, event: *mut cl_event) -> CLResult<()> {
|
||||
let q = Queue::arc_from_raw(command_queue)?;
|
||||
|
||||
|
|
@ -149,7 +149,7 @@ fn enqueue_marker(command_queue: cl_command_queue, event: *mut cl_event) -> CLRe
|
|||
)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueMarkerWithWaitList)]
|
||||
fn enqueue_marker_with_wait_list(
|
||||
command_queue: cl_command_queue,
|
||||
num_events_in_wait_list: cl_uint,
|
||||
|
|
@ -170,7 +170,7 @@ fn enqueue_marker_with_wait_list(
|
|||
)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueBarrier)]
|
||||
fn enqueue_barrier(command_queue: cl_command_queue) -> CLResult<()> {
|
||||
let q = Queue::arc_from_raw(command_queue)?;
|
||||
|
||||
|
|
@ -180,7 +180,7 @@ fn enqueue_barrier(command_queue: cl_command_queue) -> CLResult<()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clEnqueueBarrierWithWaitList)]
|
||||
fn enqueue_barrier_with_wait_list(
|
||||
command_queue: cl_command_queue,
|
||||
num_events_in_wait_list: cl_uint,
|
||||
|
|
@ -201,24 +201,24 @@ fn enqueue_barrier_with_wait_list(
|
|||
)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clFlush)]
|
||||
fn flush(command_queue: cl_command_queue) -> CLResult<()> {
|
||||
// CL_INVALID_COMMAND_QUEUE if command_queue is not a valid host command-queue.
|
||||
Queue::ref_from_raw(command_queue)?.flush(false)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clFinish)]
|
||||
fn finish(command_queue: cl_command_queue) -> CLResult<()> {
|
||||
// CL_INVALID_COMMAND_QUEUE if command_queue is not a valid host command-queue.
|
||||
Queue::ref_from_raw(command_queue)?.flush(true)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clRetainCommandQueue)]
|
||||
fn retain_command_queue(command_queue: cl_command_queue) -> CLResult<()> {
|
||||
Queue::retain(command_queue)
|
||||
}
|
||||
|
||||
#[cl_entrypoint]
|
||||
#[cl_entrypoint(clReleaseCommandQueue)]
|
||||
fn release_command_queue(command_queue: cl_command_queue) -> CLResult<()> {
|
||||
// clReleaseCommandQueue performs an implicit flush to issue any previously queued OpenCL
|
||||
// commands in command_queue.
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ use proc_macro::TokenTree::Punct;
|
|||
|
||||
/// Macro for generating the C API stubs for normal functions
|
||||
#[proc_macro_attribute]
|
||||
pub fn cl_entrypoint(_attr: TokenStream, item: TokenStream) -> TokenStream {
|
||||
pub fn cl_entrypoint(attr: TokenStream, item: TokenStream) -> TokenStream {
|
||||
let mut name = None;
|
||||
let mut args = None;
|
||||
let mut ret_type = None;
|
||||
|
|
@ -102,7 +102,7 @@ pub fn cl_entrypoint(_attr: TokenStream, item: TokenStream) -> TokenStream {
|
|||
let mut res: TokenStream = if ret_type == "()" {
|
||||
// trivial case: return the `Err(err)` as is
|
||||
format!(
|
||||
"pub extern \"C\" fn cl_{name}(
|
||||
"pub extern \"C\" fn {attr}(
|
||||
{args}
|
||||
) -> cl_int {{
|
||||
match {name}({arg_names_str}) {{
|
||||
|
|
@ -116,7 +116,7 @@ pub fn cl_entrypoint(_attr: TokenStream, item: TokenStream) -> TokenStream {
|
|||
// which return an object do have the `errcode_ret: *mut cl_int` argument last, so we can
|
||||
// just make use of this here.
|
||||
format!(
|
||||
"pub extern \"C\" fn cl_{name}(
|
||||
"pub extern \"C\" fn {attr}(
|
||||
{args}
|
||||
errcode_ret: *mut cl_int,
|
||||
) -> {ret_type} {{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue