Skip to content
Open
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
10 changes: 10 additions & 0 deletions CL/cl_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,11 @@ clGetMutableCommandInfoKHR(
#define CL_APPLE_SETMEMOBJECTDESTRUCTOR_EXTENSION_VERSION CL_MAKE_VERSION(0, 0, 0)


typedef void CL_CALLBACK clSetMemObjectDestructorAPPLE_callback_t(cl_mem memobj, void* user_data);

typedef clSetMemObjectDestructorAPPLE_callback_t *
clSetMemObjectDestructorAPPLE_callback_fn;

typedef cl_int CL_API_CALL
clSetMemObjectDestructorAPPLE_t(
cl_mem memobj,
Expand Down Expand Up @@ -2387,6 +2392,11 @@ clSVMFreeARM_t(
typedef clSVMFreeARM_t *
clSVMFreeARM_fn CL_API_SUFFIX__VERSION_1_2;

typedef void CL_CALLBACK clEnqueueSVMFreeARM_callback_t(cl_command_queue queue, cl_uint num_svm_pointers, void * svm_pointers[], void *user_data);

typedef clEnqueueSVMFreeARM_callback_t *
clEnqueueSVMFreeARM_callback_fn;

typedef cl_int CL_API_CALL
clEnqueueSVMFreeARM_t(
cl_command_queue command_queue,
Expand Down
55 changes: 55 additions & 0 deletions CL/cl_function_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ typedef cl_int CL_API_CALL clGetDeviceInfo_t(
typedef clGetDeviceInfo_t *
clGetDeviceInfo_fn CL_API_SUFFIX__VERSION_1_0;

typedef void CL_CALLBACK clCreateContext_callback_t(const char* errinfo, const void* private_info, size_t cb, void* user_data);

typedef clCreateContext_callback_t *
clCreateContext_callback_fn;

typedef cl_context CL_API_CALL clCreateContext_t(
const cl_context_properties* properties,
cl_uint num_devices,
Expand All @@ -70,6 +75,11 @@ typedef cl_context CL_API_CALL clCreateContext_t(
typedef clCreateContext_t *
clCreateContext_fn CL_API_SUFFIX__VERSION_1_0;

typedef void CL_CALLBACK clCreateContextFromType_callback_t(const char* errinfo, const void* private_info, size_t cb, void* user_data);

typedef clCreateContextFromType_callback_t *
clCreateContextFromType_callback_fn;

typedef cl_context CL_API_CALL clCreateContextFromType_t(
const cl_context_properties* properties,
cl_device_type device_type,
Expand Down Expand Up @@ -233,6 +243,11 @@ typedef cl_int CL_API_CALL clReleaseProgram_t(
typedef clReleaseProgram_t *
clReleaseProgram_fn CL_API_SUFFIX__VERSION_1_0;

typedef void CL_CALLBACK clBuildProgram_callback_t(cl_program program, void* user_data);

typedef clBuildProgram_callback_t *
clBuildProgram_callback_fn;

typedef cl_int CL_API_CALL clBuildProgram_t(
cl_program program,
cl_uint num_devices,
Expand Down Expand Up @@ -548,6 +563,11 @@ typedef cl_int CL_API_CALL clEnqueueNDRangeKernel_t(
typedef clEnqueueNDRangeKernel_t *
clEnqueueNDRangeKernel_fn CL_API_SUFFIX__VERSION_1_0;

typedef void CL_CALLBACK clEnqueueNativeKernel_callback_t(void*);

typedef clEnqueueNativeKernel_callback_t *
clEnqueueNativeKernel_callback_fn;

typedef cl_int CL_API_CALL clEnqueueNativeKernel_t(
cl_command_queue command_queue,
void (CL_CALLBACK* user_func)(void*),
Expand Down Expand Up @@ -674,6 +694,11 @@ typedef cl_mem CL_API_CALL clCreateSubBuffer_t(
typedef clCreateSubBuffer_t *
clCreateSubBuffer_fn CL_API_SUFFIX__VERSION_1_1;

typedef void CL_CALLBACK clSetMemObjectDestructorCallback_callback_t(cl_mem memobj, void* user_data);

typedef clSetMemObjectDestructorCallback_callback_t *
clSetMemObjectDestructorCallback_callback_fn;

typedef cl_int CL_API_CALL clSetMemObjectDestructorCallback_t(
cl_mem memobj,
void (CL_CALLBACK* pfn_notify)(cl_mem memobj, void* user_data),
Expand All @@ -696,6 +721,11 @@ typedef cl_int CL_API_CALL clSetUserEventStatus_t(
typedef clSetUserEventStatus_t *
clSetUserEventStatus_fn CL_API_SUFFIX__VERSION_1_1;

typedef void CL_CALLBACK clSetEventCallback_callback_t(cl_event event, cl_int event_command_status, void *user_data);

typedef clSetEventCallback_callback_t *
clSetEventCallback_callback_fn;

typedef cl_int CL_API_CALL clSetEventCallback_t(
cl_event event,
cl_int command_exec_callback_type,
Expand Down Expand Up @@ -808,6 +838,11 @@ typedef cl_program CL_API_CALL clCreateProgramWithBuiltInKernels_t(
typedef clCreateProgramWithBuiltInKernels_t *
clCreateProgramWithBuiltInKernels_fn CL_API_SUFFIX__VERSION_1_2;

typedef void CL_CALLBACK clCompileProgram_callback_t(cl_program program, void* user_data);

typedef clCompileProgram_callback_t *
clCompileProgram_callback_fn;

typedef cl_int CL_API_CALL clCompileProgram_t(
cl_program program,
cl_uint num_devices,
Expand All @@ -822,6 +857,11 @@ typedef cl_int CL_API_CALL clCompileProgram_t(
typedef clCompileProgram_t *
clCompileProgram_fn CL_API_SUFFIX__VERSION_1_2;

typedef void CL_CALLBACK clLinkProgram_callback_t(cl_program program, void* user_data);

typedef clLinkProgram_callback_t *
clLinkProgram_callback_fn;

typedef cl_program CL_API_CALL clLinkProgram_t(
cl_context context,
cl_uint num_devices,
Expand Down Expand Up @@ -992,6 +1032,11 @@ typedef cl_int CL_API_CALL clSetKernelExecInfo_t(
typedef clSetKernelExecInfo_t *
clSetKernelExecInfo_fn CL_API_SUFFIX__VERSION_2_0;

typedef void CL_CALLBACK clEnqueueSVMFree_callback_t(cl_command_queue queue, cl_uint num_svm_pointers, void* svm_pointers[], void* user_data);

typedef clEnqueueSVMFree_callback_t *
clEnqueueSVMFree_callback_fn;

typedef cl_int CL_API_CALL clEnqueueSVMFree_t(
cl_command_queue command_queue,
cl_uint num_svm_pointers,
Expand Down Expand Up @@ -1136,6 +1181,11 @@ typedef cl_int CL_API_CALL clSetProgramSpecializationConstant_t(
typedef clSetProgramSpecializationConstant_t *
clSetProgramSpecializationConstant_fn CL_API_SUFFIX__VERSION_2_2;

typedef void CL_CALLBACK clSetProgramReleaseCallback_callback_t(cl_program program, void* user_data);

typedef clSetProgramReleaseCallback_callback_t *
clSetProgramReleaseCallback_callback_fn;

typedef cl_int CL_API_CALL clSetProgramReleaseCallback_t(
cl_program program,
void (CL_CALLBACK* pfn_notify)(cl_program program, void* user_data),
Expand All @@ -1148,6 +1198,11 @@ clSetProgramReleaseCallback_fn CL_API_SUFFIX__VERSION_2_2_DEPRECATED;

#ifdef CL_VERSION_3_0

typedef void CL_CALLBACK clSetContextDestructorCallback_callback_t(cl_context context, void* user_data);

typedef clSetContextDestructorCallback_callback_t *
clSetContextDestructorCallback_callback_fn;

typedef cl_int CL_API_CALL clSetContextDestructorCallback_t(
cl_context context,
void (CL_CALLBACK* pfn_notify)(cl_context context, void* user_data),
Expand Down
11 changes: 10 additions & 1 deletion scripts/cl_ext.h.mako
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%
# re.match used to parse extension semantic versions
from re import match
from re import match, sub

# Extensions to skip by default because they are in dedicated headers:
skipExtensions = {
Expand Down Expand Up @@ -391,6 +391,15 @@ ${macros[type.get('name')].Define}
<%
api = apisigs[func.get('name')]
%>
% for paramStr in getCParameterStrings(api.Params):
% if 'CL_CALLBACK' in paramStr:
typedef ${sub(r'\s*\(\s*CL_CALLBACK\s*\*\s*[0-9a-zA-Z_]*\s*\)', ' CL_CALLBACK ' + api.Name + '_callback_t', paramStr)};

typedef ${api.Name}_callback_t *
${api.Name}_callback_fn;

% endif
% endfor
typedef ${api.RetType} CL_API_CALL
${api.Name}_t(
% for i, paramStr in enumerate(getCParameterStrings(api.Params)):
Expand Down
10 changes: 10 additions & 0 deletions scripts/cl_function_types.h.mako
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Gets C function parameter strings for the specified API params:
import sys
import json
from re import sub
def getCParameterStrings(params):
strings = []
if len(params) == 0:
Expand Down Expand Up @@ -41,6 +42,15 @@ def getCParameterStrings(params):

% endif
% for api in apis:
% for paramStr in getCParameterStrings(api.Params):
% if 'CL_CALLBACK' in paramStr:
typedef ${sub(r'\s*\(\s*CL_CALLBACK\s*\*\s*[0-9a-zA-Z_]*\s*\)', ' CL_CALLBACK ' + api.Name + '_callback_t', paramStr)};

typedef ${api.Name}_callback_t *
${api.Name}_callback_fn;

% endif
% endfor
typedef ${api.RetType} CL_API_CALL ${api.Name}_t(
% for i, paramStr in enumerate(getCParameterStrings(api.Params)):
% if i < len(api.Params)-1:
Expand Down