Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OpenCL 3.0 API clGetKernelSuggestedLocalWorkSizeKHR. #230

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions loader/icd_dispatch_generated.c
Original file line number Diff line number Diff line change
Expand Up @@ -6823,6 +6823,59 @@ static cl_int CL_API_CALL clGetKernelSubGroupInfoKHR_disp(

///////////////////////////////////////////////////////////////////////////////

// cl_khr_suggested_local_work_size

CL_API_ENTRY cl_int CL_API_CALL clGetKernelSuggestedLocalWorkSizeKHR(
cl_command_queue command_queue,
cl_kernel kernel,
cl_uint work_dim,
const size_t* global_work_offset,
const size_t* global_work_size,
size_t* suggested_local_work_size)
{
#if defined(CL_ENABLE_LAYERS)
if (khrFirstLayer)
return khrFirstLayer->dispatch.clGetKernelSuggestedLocalWorkSizeKHR(
command_queue,
kernel,
work_dim,
global_work_offset,
global_work_size,
suggested_local_work_size);
#endif // defined(CL_ENABLE_LAYERS)
KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(command_queue, CL_INVALID_COMMAND_QUEUE);
KHR_ICD_VALIDATE_POINTER_RETURN_ERROR(command_queue->dispatch->clGetKernelSuggestedLocalWorkSizeKHR);
return command_queue->dispatch->clGetKernelSuggestedLocalWorkSizeKHR(
command_queue,
kernel,
work_dim,
global_work_offset,
global_work_size,
suggested_local_work_size);
}
#if defined(CL_ENABLE_LAYERS)
static cl_int CL_API_CALL clGetKernelSuggestedLocalWorkSizeKHR_disp(
cl_command_queue command_queue,
cl_kernel kernel,
cl_uint work_dim,
const size_t* global_work_offset,
const size_t* global_work_size,
size_t* suggested_local_work_size)
{
KHR_ICD_VALIDATE_HANDLE_RETURN_ERROR(command_queue, CL_INVALID_COMMAND_QUEUE);
KHR_ICD_VALIDATE_POINTER_RETURN_ERROR(command_queue->dispatch->clGetKernelSuggestedLocalWorkSizeKHR);
return command_queue->dispatch->clGetKernelSuggestedLocalWorkSizeKHR(
command_queue,
kernel,
work_dim,
global_work_offset,
global_work_size,
suggested_local_work_size);
}
#endif // defined(CL_ENABLE_LAYERS)

///////////////////////////////////////////////////////////////////////////////

#if defined(CL_ENABLE_LAYERS)
struct _cl_icd_dispatch khrMasterDispatch = {
&clGetPlatformIDs_disp,
Expand Down Expand Up @@ -7027,6 +7080,9 @@ struct _cl_icd_dispatch khrMasterDispatch = {
&clCreateBufferWithProperties_disp,
&clCreateImageWithProperties_disp,
&clSetContextDestructorCallback_disp

/* cl_khr_suggested_local_work_size */
&clGetKernelSuggestedLocalWorkSizeKHR_disp,
};
#endif // defined(CL_ENABLE_LAYERS)
#ifdef __cplusplus
Expand Down
6 changes: 5 additions & 1 deletion scripts/icd_dispatch_generated.c.mako
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ icdextensions = [
'cl_khr_egl_image',
'cl_khr_gl_event',
'cl_khr_gl_sharing',
'cl_khr_subgroups'
'cl_khr_subgroups',
'cl_khr_suggested_local_work_size'
]
win32extensions = {
'cl_khr_d3d10_sharing',
Expand Down Expand Up @@ -482,6 +483,9 @@ struct _cl_icd_dispatch khrMasterDispatch = {
&clCreateBufferWithProperties_disp,
&clCreateImageWithProperties_disp,
&clSetContextDestructorCallback_disp

/* cl_khr_suggested_local_work_size */
&clGetKernelSuggestedLocalWorkSizeKHR_disp,
};
#endif // defined(CL_ENABLE_LAYERS)
#ifdef __cplusplus
Expand Down
6 changes: 5 additions & 1 deletion scripts/icd_print_layer_generated.c.mako
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ icdextensions = [
'cl_khr_egl_image',
'cl_khr_gl_event',
'cl_khr_gl_sharing',
'cl_khr_subgroups'
'cl_khr_subgroups',
'cl_khr_suggested_local_work_size'
]
win32extensions = {
'cl_khr_d3d10_sharing',
Expand Down Expand Up @@ -307,4 +308,7 @@ void _init_dispatch(void) {
dispatch.clCreateBufferWithProperties = &clCreateBufferWithProperties_wrap;
dispatch.clCreateImageWithProperties = &clCreateImageWithProperties_wrap;
dispatch.clSetContextDestructorCallback = &clSetContextDestructorCallback_wrap;

/* cl_khr_suggested_local_work_size */
dispatch.clGetKernelSuggestedLocalWorkSizeKHR = &clGetKernelSuggestedLocalWorkSizeKHR_wrap;
}
24 changes: 24 additions & 0 deletions test/layer/icd_print_layer_generated.c
Original file line number Diff line number Diff line change
Expand Up @@ -2540,6 +2540,27 @@ return tdispatch->clGetKernelSubGroupInfoKHR(

///////////////////////////////////////////////////////////////////////////////

// cl_khr_suggested_local_work_size
static cl_int CL_API_CALL clGetKernelSuggestedLocalWorkSizeKHR_wrap(
cl_command_queue command_queue,
cl_kernel kernel,
cl_uint work_dim,
const size_t* global_work_offset,
const size_t* global_work_size,
size_t* suggested_local_work_size) CL_API_SUFFIX__VERSION_3_0
{
printf("clGetKernelSuggestedLocalWorkSizeKHR\n");
return tdispatch->clGetKernelSuggestedLocalWorkSizeKHR(
command_queue,
kernel,
work_dim,
global_work_offset,
global_work_size,
suggested_local_work_size);
}

///////////////////////////////////////////////////////////////////////////////

void _init_dispatch(void) {
dispatch.clGetPlatformIDs = &clGetPlatformIDs_wrap;
dispatch.clGetPlatformInfo = &clGetPlatformInfo_wrap;
Expand Down Expand Up @@ -2743,4 +2764,7 @@ void _init_dispatch(void) {
dispatch.clCreateBufferWithProperties = &clCreateBufferWithProperties_wrap;
dispatch.clCreateImageWithProperties = &clCreateImageWithProperties_wrap;
dispatch.clSetContextDestructorCallback = &clSetContextDestructorCallback_wrap;

/* cl_khr_suggested_local_work_size */
dispatch.clGetKernelSuggestedLocalWorkSizeKHR = &clGetKernelSuggestedLocalWorkSizeKHR_wrap;
}