diff --git a/khronos_icd/CMakeLists.txt b/khronos_icd/CMakeLists.txt index 1dc30d2d6..8ec311d36 100644 --- a/khronos_icd/CMakeLists.txt +++ b/khronos_icd/CMakeLists.txt @@ -32,6 +32,3 @@ target_link_libraries (OpenCL_ICD ${CMAKE_DL_LIBS}) target_include_directories(OpenCL_ICD PUBLIC ${OpenCL_INCLUDE_DIR}) install(TARGETS OpenCL_ICD RUNTIME DESTINATION bin LIBRARY DESTINATION lib) - -enable_testing() -add_subdirectory (test) diff --git a/khronos_icd/test/CMakeLists.txt b/khronos_icd/test/CMakeLists.txt deleted file mode 100644 index ed84476d9..000000000 --- a/khronos_icd/test/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -include_directories (./inc) - -add_subdirectory (platform) -add_subdirectory (driver_stub) -add_subdirectory (loader_test) - -add_test (OPENCL_ICD_LOADER_TEST ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/icd_loader_test) diff --git a/khronos_icd/test/Makefile b/khronos_icd/test/Makefile deleted file mode 100644 index db52dc5cc..000000000 --- a/khronos_icd/test/Makefile +++ /dev/null @@ -1,18 +0,0 @@ - -.PHONY: all platform driver_stub loader_test clean - -all: platform driver_stub loader_test - -platform: - ${MAKE} -C platform - -driver_stub: - ${MAKE} -C driver_stub - -loader_test: - ${MAKE} -C loader_test - -clean: - ${MAKE} -C platform clean - ${MAKE} -C driver_stub clean - ${MAKE} -C loader_test clean diff --git a/khronos_icd/test/driver_stub/CMakeLists.txt b/khronos_icd/test/driver_stub/CMakeLists.txt deleted file mode 100644 index 13048172f..000000000 --- a/khronos_icd/test/driver_stub/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ - -set (OPENCL_DRIVER_STUB_SOURCES cl.c cl_ext.c cl_gl.c icd.c) - -if (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") - list (APPEND OPENCL_DRIVER_STUB_SOURCES driver_stub.def) -endif () - -add_library (OpenCLDriverStub SHARED ${OPENCL_DRIVER_STUB_SOURCES}) - -target_link_libraries (OpenCLDriverStub IcdLog) diff --git a/khronos_icd/test/driver_stub/Makefile b/khronos_icd/test/driver_stub/Makefile deleted file mode 100644 index dd79b51cd..000000000 --- a/khronos_icd/test/driver_stub/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -CC := gcc -CFLAGS := -I ../inc -I ../../ -fPIC -g -O0 - -OUTDIR := ../../bin - -${OUTDIR}/libOpenCLDriverStub.so: cl.c cl_ext.c cl_gl.c icd.c - ${CC} ${CFLAGS} -shared -Wl,-soname,$@ \ - -Wl,--version-script,icd_driver_exports.map \ - -o $@ $^ ${OUTDIR}/libIcdLog.so - -.PHONY: clean - -clean: - rm -f ${OUTDIR}/libOpenCLDriverStub.so diff --git a/khronos_icd/test/driver_stub/cl.c b/khronos_icd/test/driver_stub/cl.c deleted file mode 100644 index f84074e4a..000000000 --- a/khronos_icd/test/driver_stub/cl.c +++ /dev/null @@ -1,1917 +0,0 @@ -#include -#include -#include - -#ifndef CL_USE_DEPRECATED_OPENCL_1_0_APIS -#define CL_USE_DEPRECATED_OPENCL_1_0_APIS -#endif - -#ifndef CL_USE_DEPRECATED_OPENCL_1_1_APIS -#define CL_USE_DEPRECATED_OPENCL_1_1_APIS -#endif - -// Need to rename all CL API functions to prevent ICD loader functions calling -// themselves via the dispatch table. Include this before cl headers. -#include "rename_api.h" - -#include -#include -#include "icd_structs.h" - -#define CL_PLATFORM_ICD_SUFFIX_KHR 0x0920 -CL_API_ENTRY cl_int CL_API_CALL -clIcdGetPlatformIDsKHR(cl_uint, cl_platform_id *, cl_uint *); - -struct _cl_platform_id -{ - CLIicdDispatchTable* dispatch; - const char *profile; - const char *version; - const char *name; - const char *vendor; - const char *extensions; - const char *suffix; -}; - -struct _cl_device_id -{ - CLIicdDispatchTable* dispatch; -}; - -struct _cl_context -{ - CLIicdDispatchTable* dispatch; -}; - -struct _cl_command_queue -{ - CLIicdDispatchTable* dispatch; -}; - -struct _cl_mem -{ - CLIicdDispatchTable* dispatch; -}; - -struct _cl_program -{ - CLIicdDispatchTable* dispatch; -}; - -struct _cl_kernel -{ - CLIicdDispatchTable* dispatch; -}; - -struct _cl_event -{ - CLIicdDispatchTable* dispatch; -}; - -struct _cl_sampler -{ - CLIicdDispatchTable* dispatch; -}; - -static CLIicdDispatchTable* dispatchTable = NULL; -static cl_platform_id platform = NULL; -static cl_bool initialized = CL_FALSE; - -CL_API_ENTRY cl_int CL_API_CALL -clGetPlatformIDs(cl_uint num_entries , - cl_platform_id * platforms , - cl_uint * num_platforms) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clGetPlatformIDs(%u, %p, %p)\n", - num_entries, - platforms, - num_platforms); - return_value = clIcdGetPlatformIDsKHR(num_entries, platforms, num_platforms); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clGetPlatformInfo(cl_platform_id platform, - cl_platform_info param_name, - size_t param_value_size, - void * param_value, - size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int result = CL_SUCCESS; - cl_int return_value = CL_SUCCESS; - const char *returnString = NULL; - size_t returnStringLength = 0; - /*test_icd_stub_log("clGetPlatformInfo(%p, %u, %u, %p, %p)\n", - platform, - param_name, - param_value_size, - param_value, - param_value_size_ret);*/ - - // validate the arguments - if (param_value_size == 0 && param_value != NULL) { - return CL_INVALID_VALUE; - } - // select the string to return - switch(param_name) { - case CL_PLATFORM_PROFILE: - returnString = platform->profile; - break; - case CL_PLATFORM_VERSION: - returnString = platform->version; - break; - case CL_PLATFORM_NAME: - returnString = platform->name; - break; - case CL_PLATFORM_VENDOR: - returnString = platform->vendor; - break; - case CL_PLATFORM_EXTENSIONS: - returnString = platform->extensions; - break; - case CL_PLATFORM_ICD_SUFFIX_KHR: - returnString = platform->suffix; - break; - default: - /*test_icd_stub_log("Value returned: %d\n", - CL_INVALID_VALUE);*/ - return CL_INVALID_VALUE; - break; - } - - // make sure the buffer passed in is big enough for the result - returnStringLength = strlen(returnString)+1; - if (param_value_size && param_value_size < returnStringLength) { - /*test_icd_stub_log("Value returned: %d\n", - CL_INVALID_VALUE);*/ - return CL_INVALID_VALUE; - } - - // pass the data back to the user - if (param_value) { - memcpy(param_value, returnString, returnStringLength); - } - if (param_value_size_ret) { - *param_value_size_ret = returnStringLength; - } - - /*test_icd_stub_log("Value returned: %d\n", - return_value);*/ - return return_value; -} - - -/* Device APIs */ -CL_API_ENTRY cl_int CL_API_CALL -clGetDeviceIDs(cl_platform_id platform, - cl_device_type device_type, - cl_uint num_entries, - cl_device_id * devices, - cl_uint * num_devices) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_SUCCESS; - - if ((num_entries > 1 || num_entries < 0) && devices != NULL) { - return_value = CL_INVALID_VALUE; - } - else { - cl_device_id obj = (cl_device_id) malloc(sizeof(cl_device_id)); - obj->dispatch = dispatchTable; - *devices = obj; - } - if (num_devices) { - *num_devices = 1; - } - - test_icd_stub_log("clGetDeviceIDs(%p, %x, %u, %p, %p)\n", - platform, - device_type, - num_entries, - devices, - num_devices); - test_icd_stub_log("Value returned: %d\n", CL_SUCCESS); - return CL_SUCCESS; -} - - - -CL_API_ENTRY cl_int CL_API_CALL -clGetDeviceInfo(cl_device_id device, - cl_device_info param_name, - size_t param_value_size, - void * param_value, - size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clGetDeviceInfo(%p, %u, %u, %p, %p)\n", - device, - param_name, - param_value_size, - param_value, - param_value_size_ret); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clCreateSubDevices(cl_device_id in_device, - const cl_device_partition_property *properties, - cl_uint num_entries, - cl_device_id *out_devices, - cl_uint *num_devices) CL_API_SUFFIX__VERSION_1_2 -{ - - cl_int return_value = CL_OUT_OF_RESOURCES; - - test_icd_stub_log("clCreateSubDevices(%p, %p, %u, %p, %p)\n", - in_device, - properties, - num_entries, - out_devices, - num_devices); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - - -CL_API_ENTRY cl_int CL_API_CALL -clRetainDevice(cl_device_id device) CL_API_SUFFIX__VERSION_1_2 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clRetainDevice(%p)\n", device); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - - -CL_API_ENTRY cl_int CL_API_CALL -clReleaseDevice(cl_device_id device) CL_API_SUFFIX__VERSION_1_2 - -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clReleaseDevice(%p)\n", device); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - - -/* Context APIs */ -CL_API_ENTRY cl_context CL_API_CALL -clCreateContext(const cl_context_properties * properties, - cl_uint num_devices , - const cl_device_id * devices, - void (CL_CALLBACK * pfn_notify)(const char *, const void *, size_t, void *), - void * user_data, - cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0 -{ - cl_context obj = (cl_context) malloc(sizeof(struct _cl_context)); - obj->dispatch = dispatchTable; - test_icd_stub_log("clCreateContext(%p, %u, %p, %p, %p, %p)\n", - properties, - num_devices, - devices, - pfn_notify, - user_data, - errcode_ret); - pfn_notify(NULL, NULL, 0, NULL); - test_icd_stub_log("createcontext_callback(%p, %p, %u, %p)\n", - NULL, - NULL, - 0, - NULL); - - test_icd_stub_log("Value returned: %p\n", obj); - return obj; -} - - -CL_API_ENTRY cl_context CL_API_CALL -clCreateContextFromType(const cl_context_properties * properties, - cl_device_type device_type, - void (CL_CALLBACK * pfn_notify)(const char *, const void *, size_t, void *), - void * user_data, - cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0 -{ - cl_context obj = (cl_context) malloc(sizeof(struct _cl_context)); - obj->dispatch = dispatchTable; - test_icd_stub_log("clCreateContextFromType(%p, %x, %p, %p, %p)\n", - properties, - device_type, - pfn_notify, - user_data, - errcode_ret); - pfn_notify(NULL, NULL, 0, NULL); - - test_icd_stub_log ("createcontext_callback(%p, %p, %u, %p)\n", - NULL, - NULL, - 0, - NULL); - - test_icd_stub_log("Value returned: %p\n", - obj); - return obj; -} - -CL_API_ENTRY cl_int CL_API_CALL -clRetainContext(cl_context context) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clRetainContext(%p)\n", context); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clReleaseContext(cl_context context) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clReleaseContext(%p)\n", context); - free(context); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clGetContextInfo(cl_context context, - cl_context_info param_name, - size_t param_value_size, - void * param_value, - size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clGetContextInfo(%p, %u, %u, %p, %p)\n", - context, - param_name, - param_value_size, - param_value, - param_value_size_ret); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -/* Command Queue APIs */ -CL_API_ENTRY cl_command_queue CL_API_CALL -clCreateCommandQueue(cl_context context, - cl_device_id device, - cl_command_queue_properties properties, - cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0 -{ - cl_command_queue obj = (cl_command_queue) malloc(sizeof(struct _cl_command_queue)); - obj->dispatch = dispatchTable; - test_icd_stub_log("clCreateCommandQueue(%p, %p, %x, %p)\n", - context, - device, - properties, - errcode_ret); - - test_icd_stub_log("Value returned: %p\n", obj); - return obj; -} - -CL_API_ENTRY cl_int CL_API_CALL -clSetCommandQueueProperty(cl_command_queue command_queue , - cl_command_queue_properties properties , - cl_bool enable , - cl_command_queue_properties * old_properties) CL_EXT_SUFFIX__VERSION_1_0_DEPRECATED -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clSetCommandQueueProperty(%p, %p, %u, %p)\n", - command_queue, - properties, - enable, - old_properties); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clRetainCommandQueue(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clRetainCommandQueue(%p)\n", command_queue); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clReleaseCommandQueue(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clReleaseCommandQueue(%p)\n", command_queue); - free(command_queue); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clGetCommandQueueInfo(cl_command_queue command_queue , - cl_command_queue_info param_name , - size_t param_value_size , - void * param_value , - size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clGetCommandQueueInfo(%p, %u, %u, %p, %p)\n", - command_queue, - param_name, - param_value_size, - param_value, - param_value_size_ret); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - - - -/* Memory Object APIs */ -CL_API_ENTRY cl_mem CL_API_CALL -clCreateBuffer(cl_context context , - cl_mem_flags flags , - size_t size , - void * host_ptr , - cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0 -{ - cl_mem obj = (cl_mem) malloc(sizeof(struct _cl_mem)); - obj->dispatch = dispatchTable; - test_icd_stub_log("clCreateBuffer(%p, %x, %u, %p, %p)\n", - context, - flags, - size, - host_ptr, - errcode_ret); - - test_icd_stub_log("Value returned: %p\n", obj); - return obj; -} - -CL_API_ENTRY cl_mem CL_API_CALL -clCreateSubBuffer(cl_mem buffer , - cl_mem_flags flags , - cl_buffer_create_type buffer_create_type , - const void * buffer_create_info , - cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_1 -{ - cl_mem obj = (cl_mem) malloc(sizeof(struct _cl_mem)); - obj->dispatch = dispatchTable; - test_icd_stub_log("clCreateSubBuffer(%p, %x, %u, %p, %p)\n", - buffer, - flags, - buffer_create_type, - buffer_create_info, - errcode_ret); - - test_icd_stub_log("Value returned: %p\n", obj); - return obj; -} - -CL_API_ENTRY cl_mem CL_API_CALL -clCreateImage(cl_context context, - cl_mem_flags flags, - const cl_image_format * image_format, - const cl_image_desc * image_desc, - void * host_ptr, - cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2 -{ - cl_mem obj = (cl_mem) malloc(sizeof(struct _cl_mem)); - obj->dispatch = dispatchTable; - test_icd_stub_log("clCreateImage(%p, %x, %p, %p, %p, %p)\n", - context, - flags, - image_format, - image_desc, - host_ptr, - errcode_ret); - - test_icd_stub_log("Value returned: %p\n", obj); - return obj; -} - - -CL_API_ENTRY cl_mem CL_API_CALL -clCreateImage2D(cl_context context , - cl_mem_flags flags , - const cl_image_format * image_format , - size_t image_width , - size_t image_height , - size_t image_row_pitch , - void * host_ptr , - cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0 -{ - cl_mem obj = (cl_mem) malloc(sizeof(struct _cl_mem)); - obj->dispatch = dispatchTable; - test_icd_stub_log("clCreateImage2D(%p, %x, %p, %u, %u, %u, %p, %p)\n", - context, - flags, - image_format, - image_width, - image_height, - image_row_pitch, - host_ptr); - - test_icd_stub_log("Value returned: %p\n", obj); - return obj; -} - -CL_API_ENTRY cl_mem CL_API_CALL -clCreateImage3D(cl_context context, - cl_mem_flags flags, - const cl_image_format * image_format, - size_t image_width, - size_t image_height , - size_t image_depth , - size_t image_row_pitch , - size_t image_slice_pitch , - void * host_ptr , - cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0 -{ - cl_mem obj = (cl_mem) malloc(sizeof(struct _cl_mem)); - obj->dispatch = dispatchTable; - test_icd_stub_log("clCreateImage3D(%p, %x, %p, %u, %u, %u, %u, %u, %p, %p)\n", - context, - flags, - image_format, - image_width, - image_height, - image_depth, - image_row_pitch, - image_slice_pitch, - host_ptr, - errcode_ret); - - test_icd_stub_log("Value returned: %p\n", obj); - return obj; -} - -CL_API_ENTRY cl_int CL_API_CALL -clRetainMemObject(cl_mem memobj) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clRetainMemObject(%p)\n", memobj); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clReleaseMemObject(cl_mem memobj) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clReleaseMemObject(%p)\n", memobj); - free(memobj); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clGetSupportedImageFormats(cl_context context, - cl_mem_flags flags, - cl_mem_object_type image_type , - cl_uint num_entries , - cl_image_format * image_formats , - cl_uint * num_image_formats) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clGetSupportedImageFormats(%p, %x, %u, %u, %p, %p)\n", - context, - flags, - image_type, - num_entries, - image_formats, - num_image_formats); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clGetMemObjectInfo(cl_mem memobj , - cl_mem_info param_name , - size_t param_value_size , - void * param_value , - size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clGetMemObjectInfo(%p, %u, %u, %p, %p)\n", - memobj, - param_name, - param_value_size, - param_value, - param_value_size_ret); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clGetImageInfo(cl_mem image , - cl_image_info param_name , - size_t param_value_size , - void * param_value , - size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clGetImageInfo(%p, %u, %u, %p, %p)\n", - image, - param_name, - param_value_size, - param_value, - param_value_size_ret); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clSetMemObjectDestructorCallback(cl_mem memobj , - void (CL_CALLBACK * pfn_notify)(cl_mem memobj , void* user_data), - void * user_data) CL_API_SUFFIX__VERSION_1_1 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clSetMemObjectDestructorCallback(%p, %p, %p)\n", - memobj, - pfn_notify, - user_data); - pfn_notify(memobj, NULL); - test_icd_stub_log("setmemobjectdestructor_callback(%p, %p)\n", - memobj, - NULL); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -/* Sampler APIs */ -CL_API_ENTRY cl_sampler CL_API_CALL -clCreateSampler(cl_context context , - cl_bool normalized_coords , - cl_addressing_mode addressing_mode , - cl_filter_mode filter_mode , - cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0 -{ - cl_sampler obj = (cl_sampler) malloc(sizeof(struct _cl_sampler)); - obj->dispatch = dispatchTable; - test_icd_stub_log("clCreateSampler(%p, %u, %u, %u, %p)\n", - context, - normalized_coords, - addressing_mode, - filter_mode, - errcode_ret); - - test_icd_stub_log("Value returned: %p\n", obj); - return obj; -} - -CL_API_ENTRY cl_int CL_API_CALL -clRetainSampler(cl_sampler sampler) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clRetainSampler(%p)\n", sampler); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clReleaseSampler(cl_sampler sampler) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clReleaseSampler(%p)\n", sampler); - free(sampler); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clGetSamplerInfo(cl_sampler sampler , - cl_sampler_info param_name , - size_t param_value_size , - void * param_value , - size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clGetSamplerInfo(%p, %u, %u, %p, %p)\n", - sampler, - param_name, - param_value_size, - param_value, - param_value_size_ret); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -/* Program Object APIs */ -CL_API_ENTRY cl_program CL_API_CALL -clCreateProgramWithSource(cl_context context , - cl_uint count , - const char ** strings , - const size_t * lengths , - cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0 -{ - cl_program obj = (cl_program) malloc(sizeof(struct _cl_program)); - obj->dispatch = dispatchTable; - test_icd_stub_log("clCreateProgramWithSource(%p, %u, %p, %p, %p)\n", - context, - count, - strings, - lengths, - errcode_ret); - - test_icd_stub_log("Value returned: %p\n", obj); - return obj; -} - -CL_API_ENTRY cl_program CL_API_CALL -clCreateProgramWithBinary(cl_context context , - cl_uint num_devices , - const cl_device_id * device_list , - const size_t * lengths , - const unsigned char ** binaries , - cl_int * binary_status , - cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0 -{ - cl_program obj = (cl_program) malloc(sizeof(struct _cl_program)); - obj->dispatch = dispatchTable; - test_icd_stub_log("clCreateProgramWithBinary(%p, %u, %p, %p, %p, %p, %p)\n", - context, - num_devices, - device_list, - lengths, - binaries, - binary_status, - errcode_ret); - - test_icd_stub_log("Value returned: %p\n", obj); - return obj; -} - -CL_API_ENTRY cl_program CL_API_CALL -clCreateProgramWithBuiltInKernels(cl_context context , - cl_uint num_devices , - const cl_device_id * device_list , - const char * kernel_names , - cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2 -{ - cl_program obj = (cl_program) malloc(sizeof(struct _cl_program)); - obj->dispatch = dispatchTable; - test_icd_stub_log("clCreateProgramWithBuiltInKernels(%p, %u, %p, %p, %p)\n", - context, - num_devices, - device_list, - kernel_names, - errcode_ret); - - test_icd_stub_log("Value returned: %p\n", obj); - return obj; -} - - -CL_API_ENTRY cl_int CL_API_CALL -clRetainProgram(cl_program program) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clRetainProgram(%p)\n", - program); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clReleaseProgram(cl_program program) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clReleaseProgram(%p)\n", program); - free(program); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clBuildProgram(cl_program program , - cl_uint num_devices , - const cl_device_id * device_list , - const char * options , - void (CL_CALLBACK * pfn_notify)(cl_program program , void * user_data), - void * user_data) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clBuildProgram(%p, %u, %p, %p, %p, %p)\n", - program, - num_devices, - device_list, - options, - pfn_notify, - user_data); - pfn_notify(program, NULL); - test_icd_stub_log("program_callback(%p, %p)\n", program, NULL); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clUnloadCompiler(void) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clUnloadCompiler()\n"); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clCompileProgram(cl_program program , - cl_uint num_devices , - const cl_device_id * device_list , - const char * options , - cl_uint num_input_headers , - const cl_program * input_headers, - const char ** header_include_names , - void (CL_CALLBACK * pfn_notify)(cl_program program , void * user_data), - void * user_data) CL_API_SUFFIX__VERSION_1_2 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clCompileProgram(%p, %u, %p, %p, %u, %p, %p, %p)\n", - program, - num_devices, - device_list, - options, - num_input_headers, - header_include_names, - pfn_notify, - user_data); - pfn_notify(program, NULL); - test_icd_stub_log("program_callback(%p, %p)\n", program, NULL); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_program CL_API_CALL -clLinkProgram(cl_context context , - cl_uint num_devices , - const cl_device_id * device_list , - const char * options , - cl_uint num_input_programs , - const cl_program * input_programs , - void (CL_CALLBACK * pfn_notify)(cl_program program , void * user_data), - void * user_data , - cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_2 -{ - cl_program obj = (cl_program) malloc(sizeof(cl_program)); - obj->dispatch = dispatchTable; - test_icd_stub_log("clLinkProgram(%p, %u, %p, %p, %u, %p, %p, %p, %p)\n", - context, - num_devices, - device_list, - options, - num_input_programs, - input_programs, - pfn_notify, - user_data, - errcode_ret); - pfn_notify(obj, NULL); - test_icd_stub_log("program_callback(%p, %p)\n", obj, NULL); - test_icd_stub_log("Value returned: %p\n", obj); - return obj; -} - - -CL_API_ENTRY cl_int CL_API_CALL -clUnloadPlatformCompiler(cl_platform_id platform) CL_API_SUFFIX__VERSION_1_2 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clUnloadPlatformCompiler(%p)\n", platform); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clGetProgramInfo(cl_program program , - cl_program_info param_name , - size_t param_value_size , - void * param_value , - size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clGetProgramInfo(%p, %u, %u, %p, %p)\n", - program, - param_name, - param_value_size, - param_value, - param_value_size_ret); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clGetProgramBuildInfo(cl_program program , - cl_device_id device , - cl_program_build_info param_name , - size_t param_value_size , - void * param_value , - size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clGetProgramBuildInfo(%p, %p, %u, %u, %p, %p)\n", - program, - device, - param_name, - param_value_size, - param_value, - param_value_size_ret); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -/* Kernel Object APIs */ -CL_API_ENTRY cl_kernel CL_API_CALL -clCreateKernel(cl_program program , - const char * kernel_name , - cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0 -{ - cl_kernel obj = (cl_kernel) malloc(sizeof(struct _cl_kernel)); - obj->dispatch = dispatchTable; - test_icd_stub_log("clCreateKernel(%p, %p, %p)\n", - program, - kernel_name, - errcode_ret); - - test_icd_stub_log("Value returned: %p\n", obj); - return obj; -} - -CL_API_ENTRY cl_int CL_API_CALL -clCreateKernelsInProgram(cl_program program , - cl_uint num_kernels , - cl_kernel * kernels , - cl_uint * num_kernels_ret) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clCreateKernelsInProgram(%p, %u, %p, %p)\n", - program, - num_kernels, - kernels, - num_kernels_ret); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clRetainKernel(cl_kernel kernel) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clRetainKernel(%p)\n", kernel); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clReleaseKernel(cl_kernel kernel) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clReleaseKernel(%p)\n", kernel); - free(kernel); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clSetKernelArg(cl_kernel kernel , - cl_uint arg_index , - size_t arg_size , - const void * arg_value) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clSetKernelArg(%p, %u, %u, %p)\n", - kernel, - arg_index, - arg_size, - arg_value); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clGetKernelInfo(cl_kernel kernel , - cl_kernel_info param_name , - size_t param_value_size , - void * param_value , - size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clGetKernelInfo(%p, %u, %u, %p, %p)\n", - kernel, - param_name, - param_value_size, - param_value, - param_value_size_ret); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clGetKernelArgInfo(cl_kernel kernel , - cl_uint arg_indx , - cl_kernel_arg_info param_name , - size_t param_value_size , - void * param_value , - size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_2 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clGetKernelArgInfo(%p, %u, %u, %u, %p, %p)\n", - kernel, - arg_indx, - param_name, - param_value_size, - param_value, - param_value_size_ret); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clGetKernelWorkGroupInfo(cl_kernel kernel , - cl_device_id device , - cl_kernel_work_group_info param_name , - size_t param_value_size , - void * param_value , - size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clGetKernelWorkGroupInfo(%p, %p, %u, %u, %p, %p)\n", - kernel, - device, - param_name, - param_value_size, - param_value, - param_value_size_ret); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -/* Event Object APIs */ -CL_API_ENTRY cl_int CL_API_CALL -clWaitForEvents(cl_uint num_events , - const cl_event * event_list) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clWaitForEvents(%u, %p)\n", - num_events, - event_list); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clGetEventInfo(cl_event event , - cl_event_info param_name , - size_t param_value_size , - void * param_value , - size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clGetEventInfo(%p, %u, %u, %p, %p)\n", - event, - param_name, - param_value_size, - param_value, - param_value_size_ret); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_event CL_API_CALL -clCreateUserEvent(cl_context context , - cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_1 -{ - cl_event obj = (cl_event) malloc(sizeof(struct _cl_event)); - obj->dispatch = dispatchTable; - test_icd_stub_log("clCreateUserEvent(%p, %p)\n", context, errcode_ret); - test_icd_stub_log("Value returned: %p\n", obj); - return obj; -} - -CL_API_ENTRY cl_int CL_API_CALL -clRetainEvent(cl_event event) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clRetainEvent(%p)\n", event); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clReleaseEvent(cl_event event) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clReleaseEvent(%p)\n", event); - free(event); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clSetUserEventStatus(cl_event event , - cl_int execution_status) CL_API_SUFFIX__VERSION_1_1 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clSetUserEventStatus(%p, %d)\n", - event, - execution_status); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clSetEventCallback(cl_event event , - cl_int command_exec_callback_type , - void (CL_CALLBACK * pfn_notify)(cl_event, cl_int, void *), - void * user_data) CL_API_SUFFIX__VERSION_1_1 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clSetEventCallback(%p, %d, %p, %p)\n", - event, - command_exec_callback_type, - pfn_notify, - user_data); - pfn_notify(event, command_exec_callback_type, NULL); - test_icd_stub_log("setevent_callback(%p, %d, %p)\n", - event, - command_exec_callback_type, - NULL); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -/* Profiling APIs */ -CL_API_ENTRY cl_int CL_API_CALL -clGetEventProfilingInfo(cl_event event , - cl_profiling_info param_name , - size_t param_value_size , - void * param_value , - size_t * param_value_size_ret) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clGetEventProfilingInfo(%p, %u, %u, %p, %p)\n", - event, - param_name, - param_value_size, - param_value, - param_value_size_ret); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -/* Flush and Finish APIs */ -CL_API_ENTRY cl_int CL_API_CALL -clFlush(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clFlush(%p)\n", command_queue); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clFinish(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clFinish(%p)\n", command_queue); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -/* Enqueued Commands APIs */ -CL_API_ENTRY cl_int CL_API_CALL -clEnqueueReadBuffer(cl_command_queue command_queue , - cl_mem buffer , - cl_bool blocking_read , - size_t offset , - size_t cb , - void * ptr , - cl_uint num_events_in_wait_list , - const cl_event * event_wait_list , - cl_event * event) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clEnqueueReadBuffer(%p, %p, %u, %u, %u, %p, %u, %p, %p)\n", - command_queue, - buffer, - blocking_read, - offset, - cb, - ptr, - num_events_in_wait_list, - event_wait_list, event); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clEnqueueReadBufferRect(cl_command_queue command_queue , - cl_mem buffer , - cl_bool blocking_read , - const size_t * buffer_origin , - const size_t * host_origin , - const size_t * region , - size_t buffer_row_pitch , - size_t buffer_slice_pitch , - size_t host_row_pitch , - size_t host_slice_pitch , - void * ptr , - cl_uint num_events_in_wait_list , - const cl_event * event_wait_list , - cl_event * event) CL_API_SUFFIX__VERSION_1_1 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clEnqueueReadBufferRect(%p, %p, %u, %p, %p, %p, %u, %u, %u, %u, %p, %u, %p, %p)\n", - command_queue, - buffer, - blocking_read, - buffer_origin, - host_origin, - region, - buffer_row_pitch, - buffer_slice_pitch, - host_row_pitch, - host_slice_pitch, - ptr, - num_events_in_wait_list, - event_wait_list, - event); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clEnqueueWriteBuffer(cl_command_queue command_queue , - cl_mem buffer , - cl_bool blocking_write , - size_t offset , - size_t cb , - const void * ptr , - cl_uint num_events_in_wait_list , - const cl_event * event_wait_list , - cl_event * event) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clEnqueueWriteBuffer(%p, %p, %u, %u, %u, %p, %u, %p, %p)\n", - command_queue, - buffer, - blocking_write, - offset, - cb, - ptr, - num_events_in_wait_list, - event_wait_list, - event); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clEnqueueWriteBufferRect(cl_command_queue command_queue , - cl_mem buffer , - cl_bool blocking_write , - const size_t * buffer_origin , - const size_t * host_origin , - const size_t * region , - size_t buffer_row_pitch , - size_t buffer_slice_pitch , - size_t host_row_pitch , - size_t host_slice_pitch , - const void * ptr , - cl_uint num_events_in_wait_list , - const cl_event * event_wait_list , - cl_event * event) CL_API_SUFFIX__VERSION_1_1 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clEnqueueWriteBufferRect(%p, %p, %u, %p, %p, %p, %u, %u, %u, %u, %p, %u, %p, %p)\n", - command_queue, - buffer, - blocking_write, - buffer_origin, - host_origin, - region, - buffer_row_pitch, - buffer_slice_pitch, - host_row_pitch, - host_slice_pitch, - ptr, - num_events_in_wait_list, - event_wait_list, - event); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clEnqueueCopyBuffer(cl_command_queue command_queue , - cl_mem src_buffer , - cl_mem dst_buffer , - size_t src_offset , - size_t dst_offset , - size_t cb , - cl_uint num_events_in_wait_list , - const cl_event * event_wait_list , - cl_event * event) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clEnqueueCopyBuffer(%p, %p, %p, %u, %u, %u, %u, %p, %p)\n", - command_queue, - src_buffer, - dst_buffer, - src_offset, - dst_offset, - cb, - num_events_in_wait_list, - event_wait_list, - event); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clEnqueueCopyBufferRect(cl_command_queue command_queue , - cl_mem src_buffer , - cl_mem dst_buffer , - const size_t * src_origin , - const size_t * dst_origin , - const size_t * region , - size_t src_row_pitch , - size_t src_slice_pitch , - size_t dst_row_pitch , - size_t dst_slice_pitch , - cl_uint num_events_in_wait_list , - const cl_event * event_wait_list , - cl_event * event) CL_API_SUFFIX__VERSION_1_1 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clEnqueueCopyBufferRect(%p, %p, %p, %p, %p, %p, %u, %u, %u, %u, %u, %p, %p)\n", - command_queue, - src_buffer, - dst_buffer, - src_origin, - dst_origin, - region, - src_row_pitch, - src_slice_pitch, - dst_row_pitch, - dst_slice_pitch, - num_events_in_wait_list, - event_wait_list, - event); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - - -CL_API_ENTRY cl_int CL_API_CALL -clEnqueueFillBuffer(cl_command_queue command_queue , - cl_mem buffer , - const void * pattern , - size_t pattern_size , - size_t offset , - size_t cb , - cl_uint num_events_in_wait_list , - const cl_event * event_wait_list , - cl_event * event) CL_API_SUFFIX__VERSION_1_2 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clEnqueueFillBuffer(%p, %p, %p, %u, %u, %u, %u, %p, %p)\n", - command_queue, - buffer, - pattern, - pattern_size, - offset, - cb, - num_events_in_wait_list, - event_wait_list, - event); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - - -CL_API_ENTRY cl_int CL_API_CALL -clEnqueueFillImage(cl_command_queue command_queue , - cl_mem image , - const void * fill_color , - const size_t * origin , - const size_t * region , - cl_uint num_events_in_wait_list , - const cl_event * event_wait_list , - cl_event * event) CL_API_SUFFIX__VERSION_1_2 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clEnqueueFillImage(%p, %p, %p, %p, %p, %u, %p, %p)\n", - command_queue, - image, - fill_color, - origin, - region, - num_events_in_wait_list, - event_wait_list, - event); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - - -CL_API_ENTRY cl_int CL_API_CALL -clEnqueueReadImage(cl_command_queue command_queue , - cl_mem image , - cl_bool blocking_read , - const size_t * origin , - const size_t * region , - size_t row_pitch , - size_t slice_pitch , - void * ptr , - cl_uint num_events_in_wait_list , - const cl_event * event_wait_list , - cl_event * event) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clEnqueueReadImage(%p, %p, %u, %p, %p, %u, %u, %p, %u, %p, %p)\n", - command_queue, - image, - blocking_read, - origin, - region, - row_pitch, - slice_pitch, - ptr, - num_events_in_wait_list, - event_wait_list, - event); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clEnqueueWriteImage(cl_command_queue command_queue , - cl_mem image , - cl_bool blocking_write , - const size_t * origin , - const size_t * region , - size_t input_row_pitch , - size_t input_slice_pitch , - const void * ptr , - cl_uint num_events_in_wait_list , - const cl_event * event_wait_list , - cl_event * event) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clEnqueueWriteImage(%p, %p, %u, %p, %p, %u, %u, %p, %u, %p, %p)\n", - command_queue, - image, - blocking_write, - origin, - region, - input_row_pitch, - input_slice_pitch, - ptr, - num_events_in_wait_list, - event_wait_list, - event); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clEnqueueCopyImage(cl_command_queue command_queue , - cl_mem src_image , - cl_mem dst_image , - const size_t * src_origin , - const size_t * dst_origin , - const size_t * region , - cl_uint num_events_in_wait_list , - const cl_event * event_wait_list , - cl_event * event) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clEnqueueCopyImage(%p, %p, %p, %p, %p, %p, %u, %p, %p)\n", - command_queue, - src_image, - dst_image, - src_origin, - dst_origin, - region, - num_events_in_wait_list, - event_wait_list , - event); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clEnqueueCopyImageToBuffer(cl_command_queue command_queue , - cl_mem src_image , - cl_mem dst_buffer , - const size_t * src_origin , - const size_t * region , - size_t dst_offset , - cl_uint num_events_in_wait_list , - const cl_event * event_wait_list , - cl_event * event) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clEnqueueCopyImageToBuffer(%p, %p, %p, %p, %p, %u, %u, %p, %p)\n", - command_queue, - src_image, - dst_buffer, - src_origin, - region, - dst_offset, - num_events_in_wait_list, - event_wait_list, - event); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clEnqueueCopyBufferToImage(cl_command_queue command_queue , - cl_mem src_buffer , - cl_mem dst_image , - size_t src_offset , - const size_t * dst_origin , - const size_t * region , - cl_uint num_events_in_wait_list , - const cl_event * event_wait_list , - cl_event * event) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clEnqueueCopyBufferToImage(%p, %p, %p, %u, %p, %p, %u, %p, %p)\n", - command_queue, - src_buffer, - dst_image, - src_offset, - dst_origin, - region, - num_events_in_wait_list, - event_wait_list, - event); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY void * CL_API_CALL -clEnqueueMapBuffer(cl_command_queue command_queue , - cl_mem buffer , - cl_bool blocking_map , - cl_map_flags map_flags , - size_t offset , - size_t cb , - cl_uint num_events_in_wait_list , - const cl_event * event_wait_list , - cl_event * event , - cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0 -{ - void *return_value = (void *) malloc(sizeof(void *)); - test_icd_stub_log("clEnqueueMapBuffer(%p, %p, %u, %x, %u, %u, %u, %p, %p, %p)\n", - command_queue, - buffer, - blocking_map, - map_flags, - offset, - cb, - num_events_in_wait_list, - event_wait_list, - event, - errcode_ret); - - test_icd_stub_log("Value returned: %p\n", return_value); - return return_value; -} - -CL_API_ENTRY void * CL_API_CALL -clEnqueueMapImage(cl_command_queue command_queue , - cl_mem image , - cl_bool blocking_map , - cl_map_flags map_flags , - const size_t * origin , - const size_t * region , - size_t * image_row_pitch , - size_t * image_slice_pitch , - cl_uint num_events_in_wait_list , - const cl_event * event_wait_list , - cl_event * event , - cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0 -{ - void *return_value = (void *) malloc(sizeof(void *)); - test_icd_stub_log("clEnqueueMapImage(%p, %p, %u, %x, %p, %p, %p, %p, %u, %p, %p, %p)\n", - command_queue, - image, - blocking_map, - map_flags, - origin, - region, - image_row_pitch, - image_slice_pitch, - num_events_in_wait_list, - event_wait_list, - event, - errcode_ret); - - test_icd_stub_log("Value returned: %p\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clEnqueueUnmapMemObject(cl_command_queue command_queue , - cl_mem memobj , - void * mapped_ptr , - cl_uint num_events_in_wait_list , - const cl_event * event_wait_list , - cl_event * event) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clEnqueueUnmapMemObject(%p, %p, %p, %u, %p, %p)\n", - command_queue, - memobj, - mapped_ptr, - num_events_in_wait_list, - event_wait_list, - event); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clEnqueueMigrateMemObjects(cl_command_queue command_queue , - cl_uint num_mem_objects , - const cl_mem * mem_objects , - cl_mem_migration_flags flags , - cl_uint num_events_in_wait_list , - const cl_event * event_wait_list , - cl_event * event) CL_API_SUFFIX__VERSION_1_2 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clEnqueueMigrateMemObjects(%p, %u, %p, %x, %u, %p, %p)\n", - command_queue, - num_mem_objects, - mem_objects, - flags, - num_events_in_wait_list, - event_wait_list, - event); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - - -CL_API_ENTRY cl_int CL_API_CALL -clEnqueueNDRangeKernel(cl_command_queue command_queue , - cl_kernel kernel , - cl_uint work_dim , - const size_t * global_work_offset , - const size_t * global_work_size , - const size_t * local_work_size , - cl_uint num_events_in_wait_list , - const cl_event * event_wait_list , - cl_event * event) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clEnqueueNDRangeKernel(%p, %p, %u, %p, %p, %p, %u, %p, %p)\n", - command_queue, - kernel, - work_dim, - global_work_offset, - global_work_size, - local_work_size, - num_events_in_wait_list, - event_wait_list, - event); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clEnqueueTask(cl_command_queue command_queue , - cl_kernel kernel , - cl_uint num_events_in_wait_list , - const cl_event * event_wait_list , - cl_event * event) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clEnqueueTask(%p, %p, %u, %p, %p)\n", - command_queue, - kernel, - num_events_in_wait_list, - event_wait_list, - event); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clEnqueueNativeKernel(cl_command_queue command_queue , - void (CL_CALLBACK *user_func)(void *), - void * args , - size_t cb_args , - cl_uint num_mem_objects , - const cl_mem * mem_list , - const void ** args_mem_loc , - cl_uint num_events_in_wait_list , - const cl_event * event_wait_list , - cl_event * event) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clEnqueueNativeKernel(%p, %p, %p, %u, %u, %p, %p, %u, %p, %p)\n", - command_queue, - user_func, - args, - cb_args, - num_mem_objects, - mem_list, - args_mem_loc, - num_events_in_wait_list, - event_wait_list, - event); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY void * CL_API_CALL -clGetExtensionFunctionAddressForPlatform(cl_platform_id platform , - const char * func_name) CL_API_SUFFIX__VERSION_1_2 -{ - void *return_value = (void *) malloc(sizeof(void *)); - test_icd_stub_log("clGetExtensionFunctionAddressForPlatform(%p, %p)\n", - platform, - func_name); - - test_icd_stub_log("Value returned: %p\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clEnqueueMarkerWithWaitList(cl_command_queue command_queue , - cl_uint num_events_in_wait_list , - const cl_event * event_wait_list , - cl_event * event) CL_API_SUFFIX__VERSION_1_2 - -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clEnqueueMarkerWithWaitList(%p, %u, %p, %p)\n", - command_queue, - num_events_in_wait_list, - event_wait_list, - event); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -extern CL_API_ENTRY cl_int CL_API_CALL -clEnqueueBarrierWithWaitList(cl_command_queue command_queue , - cl_uint num_events_in_wait_list , - const cl_event * event_wait_list , - cl_event * event) CL_API_SUFFIX__VERSION_1_2 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clEnqueueBarrierWithWaitList(%p, %u, %p, %p)\n", - command_queue, - num_events_in_wait_list, - event_wait_list, - event); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -extern CL_API_ENTRY cl_int CL_API_CALL -clSetPrintfCallback(cl_context context , - void (CL_CALLBACK * pfn_notify)(cl_context program , - cl_uint printf_data_len , - char * printf_data_ptr , - void * user_data), - void * user_data) CL_API_SUFFIX__VERSION_1_2 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clSetPrintfCallback(%p, %p, %p)\n", - context, - pfn_notify, - user_data); - pfn_notify(context, 0, NULL, NULL); - test_icd_stub_log("setprintf_callback(%p, %u, %p, %p)\n", - context, - 0, - NULL, - NULL); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - - -CL_API_ENTRY cl_int CL_API_CALL -clEnqueueMarker(cl_command_queue command_queue , - cl_event * event) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clEnqueueMarker(%p, %p)\n", command_queue, event); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clEnqueueWaitForEvents(cl_command_queue command_queue , - cl_uint num_events , - const cl_event * event_list) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clEnqueueWaitForEvents(%p, %u, %p)\n", - command_queue, - num_events, - event_list); - - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -CL_API_ENTRY cl_int CL_API_CALL -clEnqueueBarrier(cl_command_queue command_queue) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int return_value = CL_OUT_OF_RESOURCES; - test_icd_stub_log("clEnqueueBarrier(%p)\n", command_queue); - test_icd_stub_log("Value returned: %d\n", return_value); - return return_value; -} - -extern cl_int cliIcdDispatchTableCreate(CLIicdDispatchTable **outDispatchTable); - -CL_API_ENTRY cl_int CL_API_CALL -clIcdGetPlatformIDsKHR(cl_uint num_entries, - cl_platform_id * platforms, - cl_uint * num_platforms) -{ - cl_int result = CL_SUCCESS; - if (!initialized) { - result = cliIcdDispatchTableCreate(&dispatchTable); - platform = (cl_platform_id) malloc(sizeof(struct _cl_platform_id)); - memset(platform, 0, sizeof(struct _cl_platform_id)); - - platform->dispatch = dispatchTable; - platform->version = "OpenCL 1.2 Stub"; - platform->vendor = "stubvendorxxx"; - platform->profile = "stubprofilexxx"; - platform->name = "ICD_LOADER_TEST_OPENCL_STUB"; - platform->extensions = "cl_khr_icd cl_khr_gl cl_khr_d3d10"; - platform->suffix = "ilts"; - platform->dispatch = dispatchTable; - initialized = CL_TRUE; - } - - if ((platforms && num_entries >1) || - (platforms && num_entries <= 0) || - (!platforms && num_entries >= 1)) { - result = CL_INVALID_VALUE; - goto Done; - } - - if (platforms && num_entries == 1) { - platforms[0] = platform; - } - -Done: - if (num_platforms) { - *num_platforms = 1; - } - - return result; -} - diff --git a/khronos_icd/test/driver_stub/cl_ext.c b/khronos_icd/test/driver_stub/cl_ext.c deleted file mode 100644 index ece0c591b..000000000 --- a/khronos_icd/test/driver_stub/cl_ext.c +++ /dev/null @@ -1,35 +0,0 @@ -#include - -#define CL_USE_DEPRECATED_OPENCL_1_1_APIS -#include "CL/cl.h" -#include "CL/cl_ext.h" - -struct driverStubextFunc_st -{ - const char *name; - void *func; -}; - -#define EXT_FUNC(name) { #name, (void*)(name) } - -static struct driverStubextFunc_st clExtensions[] = -{ - EXT_FUNC(clIcdGetPlatformIDsKHR), -}; - -static const int clExtensionCount = sizeof(clExtensions) / sizeof(clExtensions[0]); - -CL_API_ENTRY void * CL_API_CALL -clGetExtensionFunctionAddress(const char *name) -{ - int ii; - - for (ii = 0; ii < clExtensionCount; ii++) { - if (!strcmp(name, clExtensions[ii].name)) { - return clExtensions[ii].func; - } - } - - return NULL; -} - diff --git a/khronos_icd/test/driver_stub/cl_gl.c b/khronos_icd/test/driver_stub/cl_gl.c deleted file mode 100644 index 3cc5cbb80..000000000 --- a/khronos_icd/test/driver_stub/cl_gl.c +++ /dev/null @@ -1,221 +0,0 @@ -#include -#include -#include - -// Need to rename all CL API functions to prevent ICD loader functions calling -// themselves via the dispatch table. Include this before cl headers. -#include "rename_api.h" - -#define SIZE_T_MAX (size_t) 0xFFFFFFFFFFFFFFFFULL - -CL_API_ENTRY cl_mem CL_API_CALL -clCreateFromGLBuffer(cl_context context , - cl_mem_flags flags , - cl_GLuint bufret_mem , - int * errcode_ret ) CL_API_SUFFIX__VERSION_1_0 -{ - cl_mem ret_mem = (cl_mem)(SIZE_T_MAX); - test_icd_stub_log("clCreateFromGLBuffer(%p, %x, %u, %p)\n", - context, - flags, - bufret_mem, - errcode_ret); - test_icd_stub_log("Value returned: %p\n", - ret_mem); - return ret_mem; -} - -CL_API_ENTRY cl_mem CL_API_CALL -clCreateFromGLTexture(cl_context context , - cl_mem_flags flags , - cl_GLenum target , - cl_GLint miplevel , - cl_GLuint texture , - cl_int * errcode_ret ) CL_API_SUFFIX__VERSION_1_2 -{ - cl_mem ret_mem = (cl_mem)(SIZE_T_MAX); - test_icd_stub_log("clCreateFromGLTexture(%p, %x, %d, %d, %u, %p)\n", - context , - flags , - target , - miplevel , - texture , - errcode_ret ); - test_icd_stub_log("Value returned: %p\n", - ret_mem); - return ret_mem; -} - -CL_API_ENTRY cl_mem CL_API_CALL -clCreateFromGLTexture2D(cl_context context, - cl_mem_flags flags, - cl_GLenum target, - cl_GLint miplevel, - cl_GLuint texture, - cl_int * errcode_ret ) CL_API_SUFFIX__VERSION_1_0 -{ - cl_mem ret_mem = (cl_mem)(SIZE_T_MAX); - test_icd_stub_log("clCreateFromGLTexture2D(%p, %x, %d, %d, %u, %p)\n", - context, - flags, - target, - miplevel, - texture, - errcode_ret ); - test_icd_stub_log("Value returned: %p\n", - ret_mem); - return ret_mem; -} - -CL_API_ENTRY cl_mem CL_API_CALL -clCreateFromGLTexture3D(cl_context context, - cl_mem_flags flags, - cl_GLenum target, - cl_GLint miplevel, - cl_GLuint texture, - cl_int * errcode_ret ) CL_API_SUFFIX__VERSION_1_0 - -{ - cl_mem ret_mem = (cl_mem)(SIZE_T_MAX); - test_icd_stub_log("clCreateFromGLTexture3D(%p, %x, %d, %d, %u, %p)\n", - context, - flags, - target, - miplevel, - texture, - errcode_ret ); - test_icd_stub_log("Value returned: %p\n", - ret_mem); - return ret_mem; -} - -CL_API_ENTRY cl_mem CL_API_CALL -clCreateFromGLRenderbuffer(cl_context context, - cl_mem_flags flags, - cl_GLuint renderbuffer, - cl_int * errcode_ret ) CL_API_SUFFIX__VERSION_1_0 -{ - cl_mem ret_mem = (cl_mem)(SIZE_T_MAX); - test_icd_stub_log("clCreateFromGLRenderbuffer(%p, %x, %d, %p)\n", - context, - flags, - renderbuffer, - errcode_ret); - test_icd_stub_log("Value returned: %p\n", - ret_mem); - return ret_mem; -} - -CL_API_ENTRY cl_int CL_API_CALL -clGetGLObjectInfo(cl_mem memobj, - cl_gl_object_type * gl_object_type, - cl_GLuint * gl_object_name ) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int ret_val = -5; - test_icd_stub_log("clGetGLObjectInfo(%p, %p, %p)\n", - memobj, - gl_object_type, - gl_object_name); - test_icd_stub_log("Value returned: %p\n", - ret_val); - return ret_val; -} - -CL_API_ENTRY cl_int CL_API_CALL -clGetGLTextureInfo(cl_mem memobj, - cl_gl_texture_info param_name, - size_t param_value_size, - void * param_value, - size_t * param_value_size_ret ) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int ret_val = -5; - test_icd_stub_log("clGetGLTextureInfo(%p, %u, %u, %p, %p)\n", - memobj, - param_name, - param_value_size, - param_value, - param_value_size_ret ); - test_icd_stub_log("Value returned: %p\n", - ret_val); - return ret_val; -} - -CL_API_ENTRY cl_int CL_API_CALL -clEnqueueAcquireGLObjects(cl_command_queue command_queue, - cl_uint num_objects, - const cl_mem * mem_objects, - cl_uint num_events_in_wait_list, - const cl_event * event_wait_list, - cl_event * event ) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int ret_val = -5; - test_icd_stub_log("clEnqueueAcquireGLObjects(%p, %u, %p, %u, %p, %p)\n", - command_queue, - num_objects, - mem_objects, - num_events_in_wait_list, - event_wait_list, - event); - - test_icd_stub_log("Value returned: %p\n", - ret_val); - return ret_val; -} - -CL_API_ENTRY cl_int CL_API_CALL -clEnqueueReleaseGLObjects(cl_command_queue command_queue, - cl_uint num_objects, - const cl_mem * mem_objects, - cl_uint num_events_in_wait_list, - const cl_event * event_wait_list, - cl_event * event ) CL_API_SUFFIX__VERSION_1_0 - -{ - cl_int ret_val = -5; - test_icd_stub_log("clEnqueueReleaseGLObjects(%p, %u, %p, %u, %p, %p)\n", - command_queue, - num_objects, - mem_objects, - num_events_in_wait_list, - event_wait_list, - event); - test_icd_stub_log("Value returned: %p\n", - ret_val); - return ret_val; -} - -CL_API_ENTRY cl_int CL_API_CALL -clGetGLContextInfoKHR(const cl_context_properties * properties, - cl_gl_context_info param_name, - size_t param_value_size, - void * param_value, - size_t * param_value_size_ret ) CL_API_SUFFIX__VERSION_1_0 -{ - cl_int ret_val = -5; - test_icd_stub_log("clGetGLContextInfoKHR(%p, %u, %u, %p, %p)\n", - properties, - param_name, - param_value_size, - param_value, - param_value_size_ret); - - test_icd_stub_log("Value returned: %p\n", - ret_val); - return ret_val; -} - -CL_API_ENTRY cl_event CL_API_CALL -clCreateEventFromGLsyncKHR(cl_context context , - cl_GLsync cl_GLsync , - cl_int * errcode_ret ) CL_EXT_SUFFIX__VERSION_1_1 - -{ - cl_event ret_event = (cl_event)(SIZE_T_MAX); - test_icd_stub_log("clCreateEventFromGLsyncKHR(%p, %p, %p)\n", - context, - cl_GLsync, - errcode_ret); - test_icd_stub_log("Value returned: %p\n", - ret_event); - return ret_event; -} diff --git a/khronos_icd/test/driver_stub/driver_stub.def b/khronos_icd/test/driver_stub/driver_stub.def deleted file mode 100644 index 5b238e8e1..000000000 --- a/khronos_icd/test/driver_stub/driver_stub.def +++ /dev/null @@ -1,3 +0,0 @@ -EXPORTS -clGetExtensionFunctionAddress -clIcdGetPlatformIDsKHR diff --git a/khronos_icd/test/driver_stub/icd.c b/khronos_icd/test/driver_stub/icd.c deleted file mode 100644 index e456e431a..000000000 --- a/khronos_icd/test/driver_stub/icd.c +++ /dev/null @@ -1,185 +0,0 @@ -#include -#include -#include -#include -#include "icd_structs.h" - -#define CL_USE_DEPRECATED_OPENCL_1_1_APIS -#define CL_USE_DEPRECATED_OPENCL_1_0_APIS - -// Need to rename all CL API functions to prevent ICD loader functions calling -// themselves via the dispatch table. Include this before cl headers. -#include "rename_api.h" - -#include "CL/cl.h" -#include "CL/cl_gl.h" -#include "CL/cl_gl_ext.h" - -/* - * Prototypes for deprecated functions no longer present in cl.h - */ -extern CL_API_ENTRY cl_int CL_API_CALL -clSetCommandQueueProperty(cl_command_queue /* command_queue */, - cl_command_queue_properties /* properties */, - cl_bool /* enable */, - cl_command_queue_properties * /* old_properties */); - -#define ICD_DISPATCH_TABLE_ENTRY(fn) \ - assert(dispatchTable->entryCount < 256); \ - dispatchTable->entries[dispatchTable->entryCount++] = (void*)(fn) - -cl_int cliIcdDispatchTableCreate(CLIicdDispatchTable **outDispatchTable) -{ - CLIicdDispatchTable *dispatchTable = NULL; - cl_int result = CL_SUCCESS; - - // allocate the public handle - dispatchTable = (CLIicdDispatchTable *) malloc(sizeof(*dispatchTable)); - if (!dispatchTable) { - result = CL_OUT_OF_HOST_MEMORY; - goto Error; - } - memset(dispatchTable, 0, sizeof(*dispatchTable)); - - // OpenCL 1.0 - ICD_DISPATCH_TABLE_ENTRY ( clGetPlatformIDs ); - ICD_DISPATCH_TABLE_ENTRY ( clGetPlatformInfo ); - ICD_DISPATCH_TABLE_ENTRY ( clGetDeviceIDs ); - ICD_DISPATCH_TABLE_ENTRY ( clGetDeviceInfo ); - ICD_DISPATCH_TABLE_ENTRY ( clCreateContext ); - ICD_DISPATCH_TABLE_ENTRY ( clCreateContextFromType ); - ICD_DISPATCH_TABLE_ENTRY ( clRetainContext ); - ICD_DISPATCH_TABLE_ENTRY ( clReleaseContext ); - ICD_DISPATCH_TABLE_ENTRY ( clGetContextInfo ); - ICD_DISPATCH_TABLE_ENTRY ( clCreateCommandQueue ); - ICD_DISPATCH_TABLE_ENTRY ( clRetainCommandQueue ); - ICD_DISPATCH_TABLE_ENTRY ( clReleaseCommandQueue ); - ICD_DISPATCH_TABLE_ENTRY ( clGetCommandQueueInfo ); - ICD_DISPATCH_TABLE_ENTRY ( clSetCommandQueueProperty ); - ICD_DISPATCH_TABLE_ENTRY ( clCreateBuffer ); - ICD_DISPATCH_TABLE_ENTRY ( clCreateImage2D ); - ICD_DISPATCH_TABLE_ENTRY ( clCreateImage3D ); - ICD_DISPATCH_TABLE_ENTRY ( clRetainMemObject ); - ICD_DISPATCH_TABLE_ENTRY ( clReleaseMemObject ); - ICD_DISPATCH_TABLE_ENTRY ( clGetSupportedImageFormats ); - ICD_DISPATCH_TABLE_ENTRY ( clGetMemObjectInfo ); - ICD_DISPATCH_TABLE_ENTRY ( clGetImageInfo ); - ICD_DISPATCH_TABLE_ENTRY ( clCreateSampler ); - ICD_DISPATCH_TABLE_ENTRY ( clRetainSampler ); - ICD_DISPATCH_TABLE_ENTRY ( clReleaseSampler ); - ICD_DISPATCH_TABLE_ENTRY ( clGetSamplerInfo ); - ICD_DISPATCH_TABLE_ENTRY ( clCreateProgramWithSource ); - ICD_DISPATCH_TABLE_ENTRY ( clCreateProgramWithBinary ); - ICD_DISPATCH_TABLE_ENTRY ( clRetainProgram ); - ICD_DISPATCH_TABLE_ENTRY ( clReleaseProgram ); - ICD_DISPATCH_TABLE_ENTRY ( clBuildProgram ); - ICD_DISPATCH_TABLE_ENTRY ( clUnloadCompiler ); - ICD_DISPATCH_TABLE_ENTRY ( clGetProgramInfo ); - ICD_DISPATCH_TABLE_ENTRY ( clGetProgramBuildInfo ); - ICD_DISPATCH_TABLE_ENTRY ( clCreateKernel ); - ICD_DISPATCH_TABLE_ENTRY ( clCreateKernelsInProgram ); - ICD_DISPATCH_TABLE_ENTRY ( clRetainKernel ); - ICD_DISPATCH_TABLE_ENTRY ( clReleaseKernel ); - ICD_DISPATCH_TABLE_ENTRY ( clSetKernelArg ); - ICD_DISPATCH_TABLE_ENTRY ( clGetKernelInfo ); - ICD_DISPATCH_TABLE_ENTRY ( clGetKernelWorkGroupInfo ); - ICD_DISPATCH_TABLE_ENTRY ( clWaitForEvents ); - ICD_DISPATCH_TABLE_ENTRY ( clGetEventInfo ); - ICD_DISPATCH_TABLE_ENTRY ( clRetainEvent ); - ICD_DISPATCH_TABLE_ENTRY ( clReleaseEvent ); - ICD_DISPATCH_TABLE_ENTRY ( clGetEventProfilingInfo ); - ICD_DISPATCH_TABLE_ENTRY ( clFlush ); - ICD_DISPATCH_TABLE_ENTRY ( clFinish ); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueReadBuffer ); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueWriteBuffer ); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueCopyBuffer ); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueReadImage ); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueWriteImage ); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueCopyImage ); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueCopyImageToBuffer ); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueCopyBufferToImage ); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueMapBuffer ); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueMapImage ); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueUnmapMemObject ); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueNDRangeKernel ); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueTask ); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueNativeKernel ); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueMarker ); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueWaitForEvents ); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueBarrier ); - ICD_DISPATCH_TABLE_ENTRY ( clGetExtensionFunctionAddress ); - ICD_DISPATCH_TABLE_ENTRY ( clCreateFromGLBuffer ); - ICD_DISPATCH_TABLE_ENTRY ( clCreateFromGLTexture2D ); - ICD_DISPATCH_TABLE_ENTRY ( clCreateFromGLTexture3D ); - ICD_DISPATCH_TABLE_ENTRY ( clCreateFromGLRenderbuffer ); - ICD_DISPATCH_TABLE_ENTRY ( clGetGLObjectInfo ); - ICD_DISPATCH_TABLE_ENTRY ( clGetGLTextureInfo ); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueAcquireGLObjects ); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueReleaseGLObjects ); - - // cl_khr_gl_sharing - ICD_DISPATCH_TABLE_ENTRY ( clGetGLContextInfoKHR ); - - // cl_khr_d3d10_sharing (windows-only) -#if 0 && defined(_WIN32) - ICD_DISPATCH_TABLE_ENTRY ( clGetDeviceIDsFromD3D10KHR ); - ICD_DISPATCH_TABLE_ENTRY ( clCreateFromD3D10BufferKHR ); - ICD_DISPATCH_TABLE_ENTRY ( clCreateFromD3D10Texture2DKHR ); - ICD_DISPATCH_TABLE_ENTRY ( clCreateFromD3D10Texture3DKHR ); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueAcquireD3D10ObjectsKHR ); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueReleaseD3D10ObjectsKHR ); -#else - ICD_DISPATCH_TABLE_ENTRY( NULL ); - ICD_DISPATCH_TABLE_ENTRY( NULL ); - ICD_DISPATCH_TABLE_ENTRY( NULL ); - ICD_DISPATCH_TABLE_ENTRY( NULL ); - ICD_DISPATCH_TABLE_ENTRY( NULL ); - ICD_DISPATCH_TABLE_ENTRY( NULL ); -#endif - - // OpenCL 1.1 - ICD_DISPATCH_TABLE_ENTRY ( clSetEventCallback); - ICD_DISPATCH_TABLE_ENTRY ( clCreateSubBuffer); - ICD_DISPATCH_TABLE_ENTRY ( clSetMemObjectDestructorCallback); - ICD_DISPATCH_TABLE_ENTRY ( clCreateUserEvent); - ICD_DISPATCH_TABLE_ENTRY ( clSetUserEventStatus); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueReadBufferRect); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueWriteBufferRect); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueCopyBufferRect); - - ICD_DISPATCH_TABLE_ENTRY ( /*clCreateSubDevicesEXT*/NULL); - ICD_DISPATCH_TABLE_ENTRY ( /*clRetainDeviceEXT*/ NULL); - ICD_DISPATCH_TABLE_ENTRY ( /*clReleaseDevice*/NULL); - - ICD_DISPATCH_TABLE_ENTRY ( clCreateEventFromGLsyncKHR); - - ICD_DISPATCH_TABLE_ENTRY ( clCreateSubDevices); - ICD_DISPATCH_TABLE_ENTRY ( clRetainDevice); - ICD_DISPATCH_TABLE_ENTRY ( clReleaseDevice); - ICD_DISPATCH_TABLE_ENTRY ( clCreateImage); - ICD_DISPATCH_TABLE_ENTRY ( clCreateProgramWithBuiltInKernels); - ICD_DISPATCH_TABLE_ENTRY ( clCompileProgram); - ICD_DISPATCH_TABLE_ENTRY ( clLinkProgram); - ICD_DISPATCH_TABLE_ENTRY ( clUnloadPlatformCompiler); - ICD_DISPATCH_TABLE_ENTRY ( clGetKernelArgInfo); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueFillBuffer); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueFillImage); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueMigrateMemObjects); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueMarkerWithWaitList); - ICD_DISPATCH_TABLE_ENTRY ( clEnqueueBarrierWithWaitList); - ICD_DISPATCH_TABLE_ENTRY ( clGetExtensionFunctionAddressForPlatform); - ICD_DISPATCH_TABLE_ENTRY ( clCreateFromGLTexture); - - // return success - *outDispatchTable = dispatchTable; - return CL_SUCCESS; - -Error: - return result; -} - -void -cliIcdDispatchTableDestroy(CLIicdDispatchTable *dispatchTable) -{ - free(dispatchTable); -} diff --git a/khronos_icd/test/driver_stub/icd_driver_exports.map b/khronos_icd/test/driver_stub/icd_driver_exports.map deleted file mode 100644 index c6386a26e..000000000 --- a/khronos_icd/test/driver_stub/icd_driver_exports.map +++ /dev/null @@ -1,8 +0,0 @@ -{ - global: -clGetExtensionFunctionAddress; -clGetPlatformInfo; - - local: - *; -}; diff --git a/khronos_icd/test/driver_stub/icd_structs.h b/khronos_icd/test/driver_stub/icd_structs.h deleted file mode 100644 index 4b7e68b11..000000000 --- a/khronos_icd/test/driver_stub/icd_structs.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _ICD_STRUCTS_H_ -#define _ICD_STRUCTS_H_ - -typedef struct CLIicdDispatchTable_st CLIicdDispatchTable; -typedef struct CLIplatform_st CLIplatform; - -struct CLIicdDispatchTable_st -{ - void *entries[256]; - int entryCount; -}; - -struct CLIplatform_st -{ - CLIicdDispatchTable* dispatch; -}; - -#endif /* _ICD_STRUCTS_H_ */ diff --git a/khronos_icd/test/driver_stub/rename_api.h b/khronos_icd/test/driver_stub/rename_api.h deleted file mode 100644 index 7d5130cec..000000000 --- a/khronos_icd/test/driver_stub/rename_api.h +++ /dev/null @@ -1,106 +0,0 @@ -#ifndef _RENAME_API_H_ -#define _RENAME_API_H_ - -#define clGetPlatformIDs ___clGetPlatformIDs -#define clGetPlatformInfo ___clGetPlatformInfo -#define clGetDeviceIDs ___clGetDeviceIDs -#define clGetDeviceInfo ___clGetDeviceInfo -#define clCreateSubDevices ___clCreateSubDevices -#define clRetainDevice ___clRetainDevice -#define clReleaseDevice ___clReleaseDevice -#define clCreateContext ___clCreateContext -#define clCreateContextFromType ___clCreateContextFromType -#define clRetainContext ___clRetainContext -#define clReleaseContext ___clReleaseContext -#define clGetContextInfo ___clGetContextInfo -#define clCreateCommandQueue ___clCreateCommandQueue -#define clSetCommandQueueProperty ___clSetCommandQueueProperty -#define clRetainCommandQueue ___clRetainCommandQueue -#define clReleaseCommandQueue ___clReleaseCommandQueue -#define clGetCommandQueueInfo ___clGetCommandQueueInfo -#define clCreateBuffer ___clCreateBuffer -#define clCreateSubBuffer ___clCreateSubBuffer -#define clCreateImage ___clCreateImage -#define clCreateImage2D ___clCreateImage2D -#define clCreateImage3D ___clCreateImage3D -#define clRetainMemObject ___clRetainMemObject -#define clReleaseMemObject ___clReleaseMemObject -#define clGetSupportedImageFormats ___clGetSupportedImageFormats -#define clGetMemObjectInfo ___clGetMemObjectInfo -#define clGetImageInfo ___clGetImageInfo -#define clSetMemObjectDestructorCallback ___clSetMemObjectDestructorCallback -#define clCreateSampler ___clCreateSampler -#define clRetainSampler ___clRetainSampler -#define clReleaseSampler ___clReleaseSampler -#define clGetSamplerInfo ___clGetSamplerInfo -#define clCreateProgramWithSource ___clCreateProgramWithSource -#define clCreateProgramWithBinary ___clCreateProgramWithBinary -#define clCreateProgramWithBuiltInKernels ___clCreateProgramWithBuiltInKernels -#define clRetainProgram ___clRetainProgram -#define clReleaseProgram ___clReleaseProgram -#define clBuildProgram ___clBuildProgram -#define clUnloadCompiler ___clUnloadCompiler -#define clCompileProgram ___clCompileProgram -#define clLinkProgram ___clLinkProgram -#define clUnloadPlatformCompiler ___clUnloadPlatformCompiler -#define clGetProgramInfo ___clGetProgramInfo -#define clGetProgramBuildInfo ___clGetProgramBuildInfo -#define clCreateKernel ___clCreateKernel -#define clCreateKernelsInProgram ___clCreateKernelsInProgram -#define clRetainKernel ___clRetainKernel -#define clReleaseKernel ___clReleaseKernel -#define clSetKernelArg ___clSetKernelArg -#define clGetKernelInfo ___clGetKernelInfo -#define clGetKernelArgInfo ___clGetKernelArgInfo -#define clGetKernelWorkGroupInfo ___clGetKernelWorkGroupInfo -#define clWaitForEvents ___clWaitForEvents -#define clGetEventInfo ___clGetEventInfo -#define clCreateUserEvent ___clCreateUserEvent -#define clRetainEvent ___clRetainEvent -#define clReleaseEvent ___clReleaseEvent -#define clSetUserEventStatus ___clSetUserEventStatus -#define clSetEventCallback ___clSetEventCallback -#define clGetEventProfilingInfo ___clGetEventProfilingInfo -#define clFlush ___clFlush -#define clFinish ___clFinish -#define clEnqueueReadBuffer ___clEnqueueReadBuffer -#define clEnqueueReadBufferRect ___clEnqueueReadBufferRect -#define clEnqueueWriteBuffer ___clEnqueueWriteBuffer -#define clEnqueueWriteBufferRect ___clEnqueueWriteBufferRect -#define clEnqueueCopyBuffer ___clEnqueueCopyBuffer -#define clEnqueueCopyBufferRect ___clEnqueueCopyBufferRect -#define clEnqueueFillBuffer ___clEnqueueFillBuffer -#define clEnqueueFillImage ___clEnqueueFillImage -#define clEnqueueReadImage ___clEnqueueReadImage -#define clEnqueueWriteImage ___clEnqueueWriteImage -#define clEnqueueCopyImage ___clEnqueueCopyImage -#define clEnqueueCopyImageToBuffer ___clEnqueueCopyImageToBuffer -#define clEnqueueCopyBufferToImage ___clEnqueueCopyBufferToImage -#define clEnqueueMapBuffer ___clEnqueueMapBuffer -#define clEnqueueMapImage ___clEnqueueMapImage -#define clEnqueueUnmapMemObject ___clEnqueueUnmapMemObject -#define clEnqueueMigrateMemObjects ___clEnqueueMigrateMemObjects -#define clEnqueueNDRangeKernel ___clEnqueueNDRangeKernel -#define clEnqueueTask ___clEnqueueTask -#define clEnqueueNativeKernel ___clEnqueueNativeKernel -#define clGetExtensionFunctionAddressForPlatform ___clGetExtensionFunctionAddressForPlatform -#define clEnqueueMarkerWithWaitList ___clEnqueueMarkerWithWaitList -#define clEnqueueBarrierWithWaitList ___clEnqueueBarrierWithWaitList -#define clSetPrintfCallback ___clSetPrintfCallback -#define clEnqueueMarker ___clEnqueueMarker -#define clEnqueueWaitForEvents ___clEnqueueWaitForEvents -#define clEnqueueBarrier ___clEnqueueBarrier - -#define clCreateFromGLBuffer ___clCreateFromGLBuffer -#define clCreateFromGLTexture ___clCreateFromGLTexture -#define clCreateFromGLTexture2D ___clCreateFromGLTexture2D -#define clCreateFromGLTexture3D ___clCreateFromGLTexture3D -#define clCreateFromGLRenderbuffer ___clCreateFromGLRenderbuffer -#define clGetGLObjectInfo ___clGetGLObjectInfo -#define clGetGLTextureInfo ___clGetGLTextureInfo -#define clEnqueueAcquireGLObjects ___clEnqueueAcquireGLObjects -#define clEnqueueReleaseGLObjects ___clEnqueueReleaseGLObjects -#define clGetGLContextInfoKHR ___clGetGLContextInfoKHR -#define clCreateEventFromGLsyncKHR ___clCreateEventFromGLsyncKHR - -#endif /* __RENAME_API_H__ */ diff --git a/khronos_icd/test/inc/platform/icd_test_log.h b/khronos_icd/test/inc/platform/icd_test_log.h deleted file mode 100644 index 6db0bfe6a..000000000 --- a/khronos_icd/test/inc/platform/icd_test_log.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef _ICD_TEST_LOG_H_ -#define _ICD_TEST_LOG_H_ - -#if defined (_WIN32) -#define DllExport __declspec( dllexport ) -#else -#define DllExport -#endif - -DllExport int test_icd_initialize_app_log(void); -DllExport void test_icd_app_log(const char *format, ...); -DllExport void test_icd_close_app_log(void); -DllExport char *test_icd_get_stub_log(void); - -DllExport int test_icd_initialize_stub_log(void); -DllExport void test_icd_stub_log(const char *format, ...); -DllExport void test_icd_close_stub_log(void); -DllExport char *test_icd_get_app_log(void); - -#endif /* _ICD_TEST_LOG_H_ */ diff --git a/khronos_icd/test/loader_test/CMakeLists.txt b/khronos_icd/test/loader_test/CMakeLists.txt deleted file mode 100644 index ddc675b42..000000000 --- a/khronos_icd/test/loader_test/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -add_executable (icd_loader_test - test_kernel.c - main.c - test_platforms.c - icd_test_match.c - test_program_objects.c - test_sampler_objects.c - test_buffer_object.c - test_cl_runtime.c - callbacks.c - test_create_calls.c - test_clgl.c - test_image_objects.c ) - -target_link_libraries (icd_loader_test OpenCL IcdLog) diff --git a/khronos_icd/test/loader_test/Makefile b/khronos_icd/test/loader_test/Makefile deleted file mode 100644 index 4b0dfe33d..000000000 --- a/khronos_icd/test/loader_test/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -CC := gcc -CFLAGS := -I ../inc -I ../../ -g -O0 - -OUTDIR := ../../bin - -${OUTDIR}/icd_loader_test: main.c callbacks.c icd_test_match.c - -${OUTDIR}/icd_loader_test: test_buffer_object.c test_clgl.c test_cl_runtime.c test_create_calls.c test_image_objects.c - -${OUTDIR}/icd_loader_test: test_kernel.c test_platforms.c test_program_objects.c test_sampler_objects.c - ${CC} ${CFLAGS} ${OUTDIR}/libOpenCL.so -o $@ $^ ${OUTDIR}/libIcdLog.so - -.PHONY: clean - -clean: - rm -f ${OUTDIR}/icd_loader_test diff --git a/khronos_icd/test/loader_test/callbacks.c b/khronos_icd/test/loader_test/callbacks.c deleted file mode 100644 index 8e0b4934b..000000000 --- a/khronos_icd/test/loader_test/callbacks.c +++ /dev/null @@ -1,43 +0,0 @@ -#include -#include -#include - -void CL_CALLBACK createcontext_callback(const char* _a, const void* _b, size_t _c, void* _d) -{ - test_icd_app_log("createcontext_callback(%p, %p, %u, %p)\n", - _a, - _b, - _c, - _d); -} - -void CL_CALLBACK setmemobjectdestructor_callback(cl_mem _a, void* _b) -{ - test_icd_app_log("setmemobjectdestructor_callback(%p, %p)\n", - _a, - _b); -} - -void CL_CALLBACK program_callback(cl_program _a, void* _b) -{ - test_icd_app_log("program_callback(%p, %p)\n", - _a, - _b); -} - -void CL_CALLBACK setevent_callback(cl_event _a, cl_int _b, void* _c) -{ - test_icd_app_log("setevent_callback(%p, %d, %p)\n", - _a, - _b, - _c); -} - -void CL_CALLBACK setprintf_callback(cl_context _a, cl_uint _b, char* _c, void* _d ) -{ - test_icd_app_log("setprintf_callback(%p, %u, %p, %p)\n", - _a, - _b, - _c, - _d); -} diff --git a/khronos_icd/test/loader_test/icd_test_match.c b/khronos_icd/test/loader_test/icd_test_match.c deleted file mode 100644 index a58bb5fcc..000000000 --- a/khronos_icd/test/loader_test/icd_test_match.c +++ /dev/null @@ -1,36 +0,0 @@ -#include -#include -#include -#include - -int test_icd_match() -{ - int error = 0; - char *app_log = NULL, *stub_log = NULL; - - app_log = test_icd_get_app_log(); - if (!app_log) { - printf("ERROR: Could not retrieve app log\n"); - error = 1; - goto End; - } - - stub_log = test_icd_get_stub_log(); - if (!stub_log) { - printf("ERROR: Could not retrieve stub log\n"); - error = 1; - goto End; - } - - if (strcmp(app_log, stub_log)) { - printf("ERROR: App log and stub log differ.\n"); - error = 1; - goto End; - } - -End: - free(app_log); - free(stub_log); - return error; -} - diff --git a/khronos_icd/test/loader_test/main.c b/khronos_icd/test/loader_test/main.c deleted file mode 100644 index a933946fa..000000000 --- a/khronos_icd/test/loader_test/main.c +++ /dev/null @@ -1,47 +0,0 @@ -#include -#include -#include -#include "param_struct.h" - -extern int test_create_calls(); -extern int test_platforms(); -extern int test_cl_runtime(); -extern int test_kernel(); -extern int test_buffer_object(); -extern int test_program_objects(); -extern int test_image_objects(); -extern int test_sampler_objects(); -extern int initialize_log(); -extern int test_icd_match(); - -extern int test_OpenGL_share(); -extern int test_Direct3D10_share(); - -int main(int argc, char **argv) -{ - test_icd_initialize_app_log(); - test_icd_initialize_stub_log(); - - test_create_calls(); - test_platforms(); - test_cl_runtime(); - test_kernel(); - test_buffer_object(); - test_program_objects(); - test_image_objects(); - test_sampler_objects(); - test_OpenGL_share(); - -// test_Direct3D10_share(); - test_release_calls(); - test_icd_close_app_log(); - test_icd_close_stub_log(); - - if (test_icd_match()) { - printf("ICD Loader Test FAILED\n"); - return 1; - } else { - printf("ICD Loader Test PASSED\n"); - return 0; - } -} diff --git a/khronos_icd/test/loader_test/param_struct.h b/khronos_icd/test/loader_test/param_struct.h deleted file mode 100644 index 1e1aab619..000000000 --- a/khronos_icd/test/loader_test/param_struct.h +++ /dev/null @@ -1,1115 +0,0 @@ -#ifndef _PARAM_STRUCT_H_ -#define _PARAM_STRUCT_H_ - -#include -#include -#include - -#ifdef _WIN32 -#include /* Needed for gl.h */ -#endif -#include - -struct clCreateCommandQueue_st -{ - cl_context context; - cl_device_id device; - cl_command_queue_properties properties; - cl_int *errcode_ret; -}; - -struct clSetCommandQueueProperty_st -{ - cl_command_queue command_queue; - cl_command_queue_properties properties; - cl_bool enable; - cl_command_queue_properties *old_properties; -}; - -struct clGetCommandQueueInfo_st -{ - cl_command_queue command_queue; - cl_command_queue_info param_name; - size_t param_value_size; - void *param_value; - size_t *param_value_size_ret; -}; - -struct clCreateContext_st -{ - const cl_context_properties *properties; - cl_uint num_devices; - const cl_device_id *devices; - void (CL_CALLBACK*pfn_notify)(const char *errinfo, const void *private_info, size_t cb, void *user_data); - void *user_data; - cl_int *errcode_ret; -}; - -struct clCreateContextFromType_st -{ - const cl_context_properties *properties; - cl_device_type device_type; - void (CL_CALLBACK *pfn_notify)(const char *errinfo, const void *private_info, size_t cb,void *user_data); - void *user_data; - cl_int *errcode_ret; -}; - -struct clRetainContext_st -{ - cl_context context; -}; - -struct clReleaseContext_st -{ - cl_context context; -}; - -struct clGetContextInfo_st -{ - cl_context context; - cl_context_info param_name; - size_t param_value_size; - void *param_value; - size_t *param_value_size_ret; -}; - -struct clGetPlatformIDs_st -{ - cl_uint num_entries; - cl_platform_id *platforms; - cl_uint *num_platforms; -}; - -struct clGetPlatformInfo_st -{ - cl_platform_id platform; - cl_platform_info param_name; - size_t param_value_size; - void *param_value; - size_t *param_value_size_ret; -}; - -struct clGetDeviceIDs_st -{ - cl_platform_id platform; - cl_device_type device_type; - cl_uint num_entries; - cl_device_id *devices; - cl_uint *num_devices; -}; - -struct clRetainCommandQueue_st -{ - cl_command_queue command_queue; -}; - -struct clReleaseCommandQueue_st -{ - cl_command_queue command_queue; -}; - -#define NUM_ITEMS_clCreateCommandQueue 1 -#define NUM_ITEMS_clRetainCommandQueue 1 -#define NUM_ITEMS_clReleaseCommandQueue 1 -#define NUM_ITEMS_clGetCommandQueueInfo 1 -#define NUM_ITEMS_clSetCommandQueueProperty 1 -#define NUM_ITEMS_clCreateContext 1 -#define NUM_ITEMS_clCreateContextFromType 1 -#define NUM_ITEMS_clRetainContext 1 -#define NUM_ITEMS_clReleaseContext 1 -#define NUM_ITEMS_clGetContextInfo 1 -#define NUM_ITEMS_clGetPlatformIDs 1 -#define NUM_ITEMS_clGetPlatformInfo 1 -#define NUM_ITEMS_clGetDeviceIDs 1 -#define NUM_ITEMS_clGetDeviceInfo 1 -#define NUM_ITEMS_clCreateSubDevices 1 -#define NUM_ITEMS_clRetainDevice 1 -#define NUM_ITEMS_clReleaseDevice 1 - -struct clGetDeviceInfo_st -{ - cl_device_id device; - cl_device_info param_name; - size_t param_value_size; - void *param_value; - size_t *param_value_size_ret; -}; - -struct clCreateSubDevices_st -{ - cl_device_id in_device; - cl_device_partition_property *properties; - cl_uint num_entries; - cl_device_id *out_devices; - cl_uint *num_devices; -}; - -struct clRetainDevice_st -{ - cl_device_id device; -}; - -struct clReleaseDevice_st -{ - cl_device_id device; -}; - - -#define NUM_ITEMS_clCreateBuffer 1 -#define NUM_ITEMS_clCreateSubBuffer 1 -#define NUM_ITEMS_clEnqueueReadBuffer 1 -#define NUM_ITEMS_clEnqueueWriteBuffer 1 -#define NUM_ITEMS_clEnqueueReadBufferRect 1 -#define NUM_ITEMS_clEnqueueWriteBufferRect 1 -#define NUM_ITEMS_clEnqueueFillBuffer 1 -#define NUM_ITEMS_clEnqueueCopyBuffer 1 -#define NUM_ITEMS_clEnqueueCopyBufferRect 1 -#define NUM_ITEMS_clEnqueueMapBuffer 1 -#define NUM_ITEMS_clRetainMemObject 1 -#define NUM_ITEMS_clReleaseMemObject 1 -#define NUM_ITEMS_clSetMemObjectDestructorCallback 1 -#define NUM_ITEMS_clEnqueueUnmapMemObject 1 -#define NUM_ITEMS_clGetMemObjectInfo 1 - -struct clCreateBuffer_st -{ - cl_context context; - cl_mem_flags flags; - size_t size; - void *host_ptr; - cl_int *errcode_ret; -}; -struct clCreateSubBuffer_st -{ - cl_mem buffer; - cl_mem_flags flags; - cl_buffer_create_type buffer_create_type; - const void *buffer_create_info; - cl_int *errcode_ret; -}; - -struct clEnqueueReadBuffer_st -{ - cl_command_queue command_queue; - cl_mem buffer; - cl_bool blocking_read; - size_t offset; - size_t cb; - void *ptr; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event; -}; - -struct clEnqueueWriteBuffer_st -{ - cl_command_queue command_queue; - cl_mem buffer; - cl_bool blocking_write; - size_t offset; - size_t cb; - const void *ptr; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event; -}; - -struct clEnqueueReadBufferRect_st -{ - cl_command_queue command_queue; - cl_mem buffer; - cl_bool blocking_read; - const size_t * buffer_offset; - const size_t * host_offset; - const size_t * region; - size_t buffer_row_pitch; - size_t buffer_slice_pitch; - size_t host_row_pitch; - size_t host_slice_pitch; - void *ptr; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event; -}; - -struct clEnqueueWriteBufferRect_st -{ - cl_command_queue command_queue; - cl_mem buffer; - cl_bool blocking_write; - const size_t *buffer_offset; - const size_t *host_offset; - const size_t *region; - size_t buffer_row_pitch; - size_t buffer_slice_pitch; - size_t host_row_pitch; - size_t host_slice_pitch; - void *ptr; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event; -}; - -struct clEnqueueFillBuffer_st -{ - cl_command_queue command_queue; - cl_mem buffer; - const void *pattern; - size_t pattern_size; - size_t offset; - size_t cb; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event; -}; - -struct clEnqueueCopyBuffer_st -{ - cl_command_queue command_queue; - cl_mem src_buffer; - cl_mem dst_buffer; - size_t src_offset; - size_t dst_offset; - size_t cb; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event; -}; - -struct clEnqueueCopyBufferRect_st -{ - cl_command_queue command_queue; - cl_mem src_buffer; - cl_mem dst_buffer; - const size_t *src_origin; - const size_t *dst_origin; - const size_t *region; - size_t src_row_pitch; - size_t src_slice_pitch; - size_t dst_row_pitch; - size_t dst_slice_pitch; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event; -}; - -struct clEnqueueMapBuffer_st -{ - cl_command_queue command_queue; - cl_mem buffer; - cl_bool blocking_map; - cl_map_flags map_flags; - size_t offset; - size_t cb; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event; - cl_int *errcode_ret; -}; - -struct clRetainMemObject_st -{ - cl_mem memobj; -}; - -struct clReleaseMemObject_st -{ - cl_mem memobj; -}; - -struct clSetMemObjectDestructorCallback_st -{ - cl_mem memobj; - void (CL_CALLBACK *pfn_notify)(cl_mem memobj, void *user_data); - void *user_data; -}; - -struct clEnqueueUnmapMemObject_st -{ - cl_command_queue command_queue; - cl_mem memobj; - void *mapped_ptr; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event; -}; - -struct clGetMemObjectInfo_st -{ - cl_mem memobj; - cl_mem_info param_name; - size_t param_value_size; - void *param_value; - size_t *param_value_size_ret; -}; - -#define NUM_ITEMS_clCreateProgramWithSource 1 -#define NUM_ITEMS_clCreateProgramWithBinary 1 -#define NUM_ITEMS_clCreateProgramWithBuiltInKernels 1 -#define NUM_ITEMS_clRetainProgram 1 -#define NUM_ITEMS_clReleaseProgram 1 -#define NUM_ITEMS_clBuildProgram 1 -#define NUM_ITEMS_clCompileProgram 1 -#define NUM_ITEMS_clLinkProgram 1 -#define NUM_ITEMS_clUnloadPlatformCompiler 1 -#define NUM_ITEMS_clGetProgramInfo 1 -#define NUM_ITEMS_clGetProgramBuildInfo 1 -#define NUM_ITEMS_clUnloadCompiler 1 -#define NUM_ITEMS_clGetExtensionFunctionAddress 1 -#define NUM_ITEMS_clGetExtensionFunctionAddressForPlatform 1 - -struct clCreateProgramWithSource_st -{ - cl_context context; - cl_uint count; - const char **strings; - const size_t *lengths; - cl_int *errcode_ret; -}; - -struct clCreateProgramWithBinary_st -{ - cl_context context; - cl_uint num_devices; - const cl_device_id *device_list; - const size_t *lengths; - const unsigned char **binaries; - cl_int *binary_status; - cl_int *errcode_ret; -}; - -struct clCreateProgramWithBuiltInKernels_st -{ - cl_context context; - cl_uint num_devices; - const cl_device_id *device_list; - const char *kernel_names; - cl_int *errcode_ret; -}; - -struct clRetainProgram_st -{ - cl_program program; -}; - -struct clReleaseProgram_st -{ - cl_program program; -}; - -struct clBuildProgram_st -{ - cl_program program; - cl_uint num_devices; - const cl_device_id *device_list; - const char *options; - void (CL_CALLBACK*pfn_notify)(cl_program program, void *user_data); - void *user_data; -}; - -struct clCompileProgram_st -{ - cl_program program; - cl_uint num_devices; - const cl_device_id *device_list; - const char *options; - cl_uint num_input_headers; - const cl_program *headers; - const char **header_include_names; - void (CL_CALLBACK *pfn_notify)(cl_program program, void * user_data); - void *user_data; -}; - -struct clLinkProgram_st -{ - cl_context context; - cl_uint num_devices; - const cl_device_id *device_list; - const char *options; - cl_uint num_input_programs; - const cl_program *input_programs; - void (CL_CALLBACK *pfn_notify)(cl_program program, void *user_data); - void *user_data; - cl_int *errcode_ret; -}; - -struct clUnloadPlatformCompiler_st -{ - cl_platform_id platform; -}; - -#if 0 -struct clUnloadCompiler_st -{ - void ; -}; -#endif - -struct clGetExtensionFunctionAddress_st -{ - const char *func_name; -}; - -struct clGetExtensionFunctionAddressForPlatform_st -{ - cl_platform_id platform; - const char *func_name; -}; - -struct clGetProgramInfo_st -{ - cl_program program; - cl_program_info param_name; - size_t param_value_size; - void *param_value; - size_t *param_value_size_ret; -}; - -struct clGetProgramBuildInfo_st -{ - cl_program program; - cl_device_id device; - cl_program_build_info param_name; - size_t param_value_size; - void *param_value; - size_t *param_value_size_ret; -}; - -#define NUM_ITEMS_clCreateImage2D 1 -#define NUM_ITEMS_clCreateImage3D 1 -#define NUM_ITEMS_clCreateImage 1 -#define NUM_ITEMS_clGetSupportedImageFormats 1 -#define NUM_ITEMS_clEnqueueCopyImageToBuffer 1 -#define NUM_ITEMS_clEnqueueCopyBufferToImage 1 -#define NUM_ITEMS_clEnqueueMapImage 1 -#define NUM_ITEMS_clEnqueueReadImage 1 -#define NUM_ITEMS_clEnqueueWriteImage 1 -#define NUM_ITEMS_clEnqueueFillImage 1 -#define NUM_ITEMS_clEnqueueCopyImage 1 -#define NUM_ITEMS_clGetMemObjectInfo 1 -#define NUM_ITEMS_clGetImageInfo 1 - -struct clCreateImage_st -{ - cl_context context; - cl_mem_flags flags; - const cl_image_format *image_format; - const cl_image_desc *image_desc; - void *host_ptr; - cl_int *errcode_ret; -}; - -struct clCreateImage2D_st -{ - cl_context context; - cl_mem_flags flags; - const cl_image_format *image_format; - size_t image_width; - size_t image_height; - size_t image_row_pitch; - void *host_ptr; - cl_int *errcode_ret; -}; - -struct clCreateImage3D_st -{ - cl_context context; - cl_mem_flags flags; - const cl_image_format *image_format; - size_t image_width; - size_t image_height; - size_t image_depth; - size_t image_row_pitch; - size_t image_slice_pitch; - void *host_ptr; - cl_int *errcode_ret; -}; - -struct clGetSupportedImageFormats_st -{ - cl_context context; - cl_mem_flags flags; - cl_mem_object_type image_type; - cl_uint num_entries; - cl_image_format *image_formats; - cl_uint *num_image_formats; -}; - -struct clEnqueueCopyImageToBuffer_st -{ - cl_command_queue command_queue; - cl_mem src_image; - cl_mem dst_buffer; - const size_t *src_origin; - const size_t *region; - size_t dst_offset; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event; -}; - -struct clEnqueueCopyBufferToImage_st -{ - cl_command_queue command_queue; - cl_mem src_buffer; - cl_mem dst_image; - size_t src_offset; - const size_t *dst_origin; - const size_t *region; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event; -}; - -struct clEnqueueMapImage_st -{ - cl_command_queue command_queue; - cl_mem image; - cl_bool blocking_map; - cl_map_flags map_flags; - const size_t *origin; - const size_t *region; - size_t *image_row_pitch; - size_t *image_slice_pitch; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event; - cl_int *errcode_ret; -}; - -struct clEnqueueReadImage_st -{ - cl_command_queue command_queue; - cl_mem image; - cl_bool blocking_read; - const size_t *origin; - const size_t *region; - size_t row_pitch; - size_t slice_pitch; - void *ptr; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event; -}; - -struct clEnqueueWriteImage_st -{ - cl_command_queue command_queue; - cl_mem image; - cl_bool blocking_write; - const size_t *origin; - const size_t *region; - size_t input_row_pitch; - size_t input_slice_pitch; - const void *ptr; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event; -}; - -struct clEnqueueFillImage_st -{ - cl_command_queue command_queue; - cl_mem image; - const void *fill_color; - const size_t *origin; - const size_t *region; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event; -}; - -struct clEnqueueCopyImage_st -{ - cl_command_queue command_queue; - cl_mem src_image; - cl_mem dst_image; - const size_t *src_origin; - const size_t *dst_origin; - const size_t *region; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event; -}; - -#if 0 -struct clGetMemObjectInfo_st -{ - cl_mem memobj; - cl_mem_info param_name; - size_t param_value_size; - void *param_value; - size_t *param_value_size_ret; -}; -#endif - -struct clGetImageInfo_st -{ - cl_mem image; - cl_image_info param_name; - size_t param_value_size; - void *param_value; - size_t *param_value_size_ret; -}; - -#define NUM_ITEMS_clCreateSampler 1 -#define NUM_ITEMS_clRetainSampler 1 -#define NUM_ITEMS_clReleaseSampler 1 -#define NUM_ITEMS_clGetSamplerInfo 1 - -struct clCreateSampler_st -{ - cl_context context; - cl_bool normalized_coords; - cl_addressing_mode addressing_mode; - cl_filter_mode filter_mode; - cl_int *errcode_ret; -}; - -struct clRetainSampler_st -{ - cl_sampler sampler; -}; - -struct clReleaseSampler_st -{ - cl_sampler sampler; -}; - -struct clGetSamplerInfo_st -{ - cl_sampler sampler; - cl_sampler_info param_name; - size_t param_value_size; - void *param_value; - size_t *param_value_size_ret; -}; - -#define NUM_ITEMS_clCreateKernel 1 -#define NUM_ITEMS_clCreateKernelsInProgram 1 -#define NUM_ITEMS_clRetainKernel 1 -#define NUM_ITEMS_clReleaseKernel 1 - -struct clCreateKernel_st -{ - cl_program program; - const char *kernel_name; - cl_int *errcode_ret; -}; - -struct clCreateKernelsInProgram_st -{ - cl_program program; - cl_uint num_kernels; - cl_kernel *kernels; - cl_uint *num_kernels_ret; -}; - -struct clRetainKernel_st -{ - cl_kernel kernel; -}; - -struct clReleaseKernel_st -{ - cl_kernel kernel; -}; - -#define NUM_ITEMS_clSetKernelArg 1 -#define NUM_ITEMS_clGetKernelInfo 1 -#define NUM_ITEMS_clGetKernelArgInfo 1 -#define NUM_ITEMS_clGetKernelWorkGroupInfo 1 - -struct clSetKernelArg_st -{ - cl_kernel kernel; - cl_uint arg_index; - size_t arg_size; - const void *arg_value; -}; - -struct clGetKernelInfo_st -{ - cl_kernel kernel; - cl_kernel_info param_name; - size_t param_value_size; - void *param_value; - size_t *param_value_size_ret; -}; - -struct clGetKernelArgInfo_st -{ - cl_kernel kernel; - cl_uint arg_indx; - cl_kernel_arg_info param_name; - size_t param_value_size; - void *param_value; - size_t *param_value_size_ret; -}; - -struct clGetKernelWorkGroupInfo_st -{ - cl_kernel kernel; - cl_device_id device; - cl_kernel_work_group_info param_name; - size_t param_value_size; - void *param_value; - size_t *param_value_size_ret; -}; - -#define NUM_ITEMS_clEnqueueMigrateMemObjects 1 -#define NUM_ITEMS_clEnqueueNDRangeKernel 1 -#define NUM_ITEMS_clEnqueueTask 1 -#define NUM_ITEMS_clEnqueueNativeKernel 1 - -struct clEnqueueMigrateMemObjects_st -{ - cl_command_queue command_queue; - size_t num_mem_objects; - const cl_mem *mem_objects; - cl_mem_migration_flags flags; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event; -}; - -struct clEnqueueNDRangeKernel_st -{ - cl_command_queue command_queue; - cl_kernel kernel; cl_uint work_dim; - const size_t *global_work_offset; - const size_t *global_work_size; - const size_t *local_work_size; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event; -}; - -struct clEnqueueTask_st -{ - cl_command_queue command_queue; - cl_kernel kernel; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event; -}; - -struct clEnqueueNativeKernel_st -{ - cl_command_queue command_queue; - void (CL_CALLBACK *user_func)(void *); - void *args; - size_t cb_args; - cl_uint num_mem_objects; - const cl_mem *mem_list; - const void **args_mem_loc; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event; -}; - -#define NUM_ITEMS_clCreateUserEvent 1 -#define NUM_ITEMS_clSetUserEventStatus 1 -#define NUM_ITEMS_clWaitForEvents 1 -#define NUM_ITEMS_clGetEventInfo 1 -#define NUM_ITEMS_clSetEventCallback 1 -#define NUM_ITEMS_clRetainEvent 1 -#define NUM_ITEMS_clReleaseEvent 1 - -struct clCreateUserEvent_st -{ - cl_context context; - cl_int *errcode_ret; -}; - -struct clSetUserEventStatus_st -{ - cl_event event; - cl_int execution_status; -}; - -struct clWaitForEvents_st -{ - cl_uint num_events; - const cl_event *event_list; -}; - -struct clGetEventInfo_st -{ - cl_event event; - cl_event_info param_name; - size_t param_value_size; - void *param_value; - size_t *param_value_size_ret; -}; - -struct clSetEventCallback_st -{ - cl_event event; - cl_int command_exec_callback_type; - void (CL_CALLBACK *pfn_event_notify)(cl_event event, cl_int event_command_exec_status,void *user_data); - void *user_data; -}; - -struct clRetainEvent_st -{ - cl_event event; -}; - -struct clReleaseEvent_st -{ - cl_event event; -}; - -#define NUM_ITEMS_clEnqueueMarker 1 -#define NUM_ITEMS_clEnqueueWaitForEvents 1 -#define NUM_ITEMS_clEnqueueBarrier 1 -#define NUM_ITEMS_clEnqueueMarkerWithWaitList 1 -#define NUM_ITEMS_clEnqueueBarrierWithWaitList 1 - -struct clEnqueueMarker_st -{ - cl_command_queue command_queue; - cl_event *event; -}; - -struct clEnqueueWaitForEvents_st -{ - cl_command_queue command_queue; - cl_uint num_events; - const cl_event *event_list; -}; - -struct clEnqueueBarrier_st -{ - cl_command_queue command_queue; -}; - -struct clEnqueueMarkerWithWaitList_st -{ - cl_command_queue command_queue; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event; -}; - -struct clEnqueueBarrierWithWaitList_st -{ - cl_command_queue command_queue; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event; -}; - -#define NUM_ITEMS_clGetEventProfilingInfo 1 - -struct clGetEventProfilingInfo_st -{ - cl_event event; - cl_profiling_info param_name; - size_t param_value_size; - void *param_value; - size_t *param_value_size_ret; -}; - -#define NUM_ITEMS_clFlush 1 -#define NUM_ITEMS_clFinish 1 - -struct clFlush_st -{ - cl_command_queue command_queue; -}; - -struct clFinish_st -{ - cl_command_queue command_queue; -}; - -#define NUM_ITEMS_clCreateFromGLBuffer 1 -struct clCreateFromGLBuffer_st -{ - cl_context context; - cl_mem_flags flags; - GLuint bufobj; - int *errcode_ret; -}; - -#define NUM_ITEMS_clCreateFromGLTexture 1 -#define NUM_ITEMS_clCreateFromGLTexture2D 1 -#define NUM_ITEMS_clCreateFromGLTexture3D 1 - -struct clCreateFromGLTexture_st -{ - cl_context context; - cl_mem_flags flags; - GLenum texture_target; - GLint miplevel; - GLuint texture; - cl_int *errcode_ret; -}; - -struct clCreateFromGLTexture2D_st -{ - cl_context context; - cl_mem_flags flags; - GLenum texture_target; - GLint miplevel; - GLuint texture; - cl_int *errcode_ret; -}; - -struct clCreateFromGLTexture3D_st -{ - cl_context context; - cl_mem_flags flags; - GLenum texture_target; - GLint miplevel; - GLuint texture; - cl_int *errcode_ret; -}; - -#define NUM_ITEMS_clCreateFromGLRenderbuffer 1 - -struct clCreateFromGLRenderbuffer_st -{ - cl_context context; - cl_mem_flags flags; - GLuint renderbuffer; - cl_int *errcode_ret; -}; - - - // Query Information [9.8.5] -#define NUM_ITEMS_clGetGLObjectInfo 1 -#define NUM_ITEMS_clGetGLTextureInfo 1 - -struct clGetGLObjectInfo_st -{ - cl_mem memobj; - cl_gl_object_type *gl_object_type; - GLuint *gl_object_name; -}; - -struct clGetGLTextureInfo_st -{ - cl_mem memobj; - cl_gl_texture_info param_name; - size_t param_value_size; - void *param_value; - size_t *param_value_size_ret; -}; - -// Share Objects [9.8.6] - -#define NUM_ITEMS_clEnqueueAcquireGLObjects 1 -#define NUM_ITEMS_clEnqueueReleaseGLObjects 1 - -struct clEnqueueAcquireGLObjects_st -{ - cl_command_queue command_queue; - cl_uint num_objects; - const cl_mem *mem_objects; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event; -}; - -struct clEnqueueReleaseGLObjects_st -{ - cl_command_queue command_queue; - cl_uint num_objects; - const cl_mem *mem_objects; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event; -}; - -// CL Event Objects > GL Sync Objects [9.9] -#define NUM_ITEMS_clCreateEventFromGLsyncKHR 1 - -struct clCreateEventFromGLsyncKHR_st -{ - cl_context context; - cl_GLsync sync; - cl_int *errcode_ret; -}; - -// CL Context > GL Context; Sharegroup [9.7] -#define NUM_ITEMS_clGetGLContextInfoKHR 1 - -struct clGetGLContextInfoKHR_st -{ - const cl_context_properties *properties; - cl_gl_context_info param_name; - size_t param_value_size; - void *param_value; - size_t *param_value_size_ret; -}; - -#if 0 -// OpenCL/Direct3D 10 Sharing APIs [9.10] - -#define NUM_ITEMS_clGetDeviceIDsFromD3D10KHR 1 -#define NUM_ITEMS_clCreateFromD3D10BufferKHR 1 -#define NUM_ITEMS_clCreateFromD3D10Texture2DKHR 1 -#define NUM_ITEMS_clCreateFromD3D10Texture3DKHR 1 -#define NUM_ITEMS_clEnqueueAcquireD3D10ObjectsKHR 1 -#define NUM_ITEMS_clEnqueueReleaseD3D10ObjectsKHR 1 - -struct clGetDeviceIDsFromD3D10KHR_st -{ - cl_platform_id platform; - cl_d3d10_device_source_khr d3d_device_source; - void *d3d_object; - cl_d3d10_device_set_khr d3d_device_set; - cl_uint num_entries; - cl_device_id *devices; cl_uint *num_devices; -}; - -struct clCreateFromD3D10BufferKHR_st -{ - cl_context context; - cl_mem_flags flags; - ID3D10Buffer *resource; - cl_int *errcode_ret; -}; - -struct clCreateFromD3D10Texture2DKHR_st -{ - cl_context context; - cl_mem_flags flags; - ID3D10Texture2D *resource; - UINT subresource; - cl_int *errcode_ret; -}; - -struct clCreateFromD3D10Texture3DKHR_st -{ - cl_context context; - cl_mem_flags flags; - ID3D10Texture3D *resource; - UINT subresource; - cl_int *errcode_ret; -}; - -struct clEnqueueAcquireD3D10ObjectsKHR_st -{ - cl_command_queue command_queue; - cl_uint num_objects; - const cl_mem *mem_objects; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event;}; - -struct clEnqueueReleaseD3D10ObjectsKHR_st -{ - cl_command_queue command_queue; - cl_uint num_objects; - const cl_mem *mem_objects; - cl_uint num_events_in_wait_list; - const cl_event *event_wait_list; - cl_event *event; -}; -#endif - -#endif /* _PARAM_STRUCT_H_ */ diff --git a/khronos_icd/test/loader_test/test_buffer_object.c b/khronos_icd/test/loader_test/test_buffer_object.c deleted file mode 100644 index 85a2178c6..000000000 --- a/khronos_icd/test/loader_test/test_buffer_object.c +++ /dev/null @@ -1,461 +0,0 @@ -#include -#include "param_struct.h" -#include - -extern cl_mem buffer; -extern cl_command_queue command_queue; -extern cl_event event; - -static int ret_val; - -extern void CL_CALLBACK setmemobjectdestructor_callback(cl_mem _a, void* _b); - -const struct clEnqueueReadBuffer_st clEnqueueReadBufferData[NUM_ITEMS_clEnqueueReadBuffer] = -{ - {NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL} -}; - -const struct clEnqueueWriteBuffer_st clEnqueueWriteBufferData[NUM_ITEMS_clEnqueueWriteBuffer] = -{ - {NULL, NULL, 0, 0, 0, NULL, 0, NULL, NULL} -}; - -const struct clEnqueueReadBufferRect_st clEnqueueReadBufferRectData[NUM_ITEMS_clEnqueueReadBufferRect] = -{ - {NULL, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, NULL, 0, NULL, NULL} -}; - -const struct clEnqueueWriteBufferRect_st clEnqueueWriteBufferRectData[NUM_ITEMS_clEnqueueWriteBufferRect] = -{ - {NULL, NULL, 0, NULL, NULL, NULL, 0, 0, 0, 0, NULL, 0, NULL, NULL} -}; - -const struct clEnqueueFillBuffer_st clEnqueueFillBufferData[NUM_ITEMS_clEnqueueFillBuffer] = -{ - {NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL} -}; - -const struct clEnqueueCopyBuffer_st clEnqueueCopyBufferData[NUM_ITEMS_clEnqueueCopyBuffer] = -{ - {NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL} -}; - -const struct clEnqueueCopyBufferRect_st clEnqueueCopyBufferRectData[NUM_ITEMS_clEnqueueCopyBufferRect] = -{ - {NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL} -}; - -const struct clEnqueueMapBuffer_st clEnqueueMapBufferData[NUM_ITEMS_clEnqueueMapBuffer] = -{ - {NULL, NULL, 0, 0, 0, 0, 0, NULL, NULL, NULL} -}; - -const struct clRetainMemObject_st clRetainMemObjectData[NUM_ITEMS_clRetainMemObject] = -{ - {NULL} -}; - -const struct clSetMemObjectDestructorCallback_st clSetMemObjectDestructorCallbackData[NUM_ITEMS_clSetMemObjectDestructorCallback] = -{ - {NULL, setmemobjectdestructor_callback, NULL} -}; - -const struct clEnqueueUnmapMemObject_st clEnqueueUnmapMemObjectData[NUM_ITEMS_clEnqueueUnmapMemObject] = -{ - {NULL, NULL, NULL, 0, NULL, NULL} -}; - -const struct clGetMemObjectInfo_st clGetMemObjectInfoData[NUM_ITEMS_clGetMemObjectInfo] = -{ - {NULL, 0, 0, NULL, NULL} -}; - -int test_clEnqueueReadBuffer(const struct clEnqueueReadBuffer_st *data) -{ - test_icd_app_log("clEnqueueReadBuffer(%p, %p, %u, %u, %u, %p, %u, %p, %p)\n", - command_queue, - buffer, - data->blocking_read, - data->offset, - data->cb, - data->ptr, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - ret_val=clEnqueueReadBuffer(command_queue, - buffer, - data->blocking_read, - data->offset, - data->cb, - data->ptr, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -int test_clEnqueueWriteBuffer(const struct clEnqueueWriteBuffer_st *data) -{ - test_icd_app_log("clEnqueueWriteBuffer(%p, %p, %u, %u, %u, %p, %u, %p, %p)\n", - command_queue, - buffer, - data->blocking_write, - data->offset, - data->cb, - data->ptr, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - ret_val=clEnqueueWriteBuffer(command_queue, - buffer, - data->blocking_write, - data->offset, - data->cb, - data->ptr, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -int test_clEnqueueReadBufferRect(const struct clEnqueueReadBufferRect_st *data) -{ - test_icd_app_log("clEnqueueReadBufferRect(%p, %p, %u, %p, %p, %p, %u, %u, %u, %u, %p, %u, %p, %p)\n", - command_queue, - buffer, - data->blocking_read, - data->buffer_offset, - data->host_offset, - data->region, - data->buffer_row_pitch, - data->buffer_slice_pitch, - data->host_row_pitch, - data->host_slice_pitch, - data->ptr, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - ret_val=clEnqueueReadBufferRect(command_queue, - buffer, - data->blocking_read, - data->buffer_offset, - data->host_offset, - data->region, - data->buffer_row_pitch, - data->buffer_slice_pitch, - data->host_row_pitch, - data->host_slice_pitch, - data->ptr, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -int test_clEnqueueWriteBufferRect(const struct clEnqueueWriteBufferRect_st *data) -{ - test_icd_app_log("clEnqueueWriteBufferRect(%p, %p, %u, %p, %p, %p, %u, %u, %u, %u, %p, %u, %p, %p)\n", - command_queue, - buffer, - data->blocking_write, - data->buffer_offset, - data->host_offset, - data->region, - data->buffer_row_pitch, - data->buffer_slice_pitch, - data->host_row_pitch, - data->host_slice_pitch, - data->ptr, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - ret_val=clEnqueueWriteBufferRect(command_queue, - buffer, - data->blocking_write, - data->buffer_offset, - data->host_offset, - data->region, - data->buffer_row_pitch, - data->buffer_slice_pitch, - data->host_row_pitch, - data->host_slice_pitch, - data->ptr, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -int test_clEnqueueFillBuffer(const struct clEnqueueFillBuffer_st *data) -{ - test_icd_app_log("clEnqueueFillBuffer(%p, %p, %p, %u, %u, %u, %u, %p, %p)\n", - command_queue, - buffer, - data->pattern, - data->pattern_size, - data->offset, - data->cb, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - ret_val=clEnqueueFillBuffer(command_queue, - buffer, - data->pattern, - data->pattern_size, - data->offset, - data->cb, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -int test_clEnqueueCopyBuffer(const struct clEnqueueCopyBuffer_st *data) -{ - test_icd_app_log("clEnqueueCopyBuffer(%p, %p, %p, %u, %u, %u, %u, %p, %p)\n", - command_queue, - data->src_buffer, - buffer, - data->src_offset, - data->dst_offset, - data->cb, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - ret_val=clEnqueueCopyBuffer(command_queue, - data->src_buffer, - buffer, - data->src_offset, - data->dst_offset, - data->cb, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -int test_clEnqueueCopyBufferRect(const struct clEnqueueCopyBufferRect_st *data) -{ - test_icd_app_log("clEnqueueCopyBufferRect(%p, %p, %p, %p, %p, %p, %u, %u, %u, %u, %u, %p, %p)\n", - command_queue, - buffer, - buffer, - data->src_origin, - data->dst_origin, - data->region, - data->src_row_pitch, - data->src_slice_pitch, - data->dst_row_pitch, - data->dst_slice_pitch, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - ret_val=clEnqueueCopyBufferRect(command_queue, - buffer, - buffer, - data->src_origin, - data->dst_origin, - data->region, - data->src_row_pitch, - data->src_slice_pitch, - data->dst_row_pitch, - data->dst_slice_pitch, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -int test_clEnqueueMapBuffer(const struct clEnqueueMapBuffer_st *data) -{ - void * return_value; - test_icd_app_log("clEnqueueMapBuffer(%p, %p, %u, %x, %u, %u, %u, %p, %p, %p)\n", - command_queue, - buffer, - data->blocking_map, - data->map_flags, - data->offset, - data->cb, - data->num_events_in_wait_list, - data->event_wait_list, - &event, - data->errcode_ret); - - return_value=clEnqueueMapBuffer(command_queue, - buffer, - data->blocking_map, - data->map_flags, - data->offset, - data->cb, - data->num_events_in_wait_list, - data->event_wait_list, - &event, - data->errcode_ret); - - test_icd_app_log("Value returned: %p\n", return_value); - - free(return_value); - - return 0; - -} - -int test_clRetainMemObject(const struct clRetainMemObject_st *data) -{ - test_icd_app_log("clRetainMemObject(%p)\n", buffer); - - ret_val=clRetainMemObject(buffer); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -int test_clSetMemObjectDestructorCallback(const struct clSetMemObjectDestructorCallback_st *data) -{ - test_icd_app_log("clSetMemObjectDestructorCallback(%p, %p, %p)\n", - buffer, - data->pfn_notify, - data->user_data); - - ret_val=clSetMemObjectDestructorCallback(buffer, - data->pfn_notify, - data->user_data); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -int test_clEnqueueUnmapMemObject(const struct clEnqueueUnmapMemObject_st *data) -{ - test_icd_app_log("clEnqueueUnmapMemObject(%p, %p, %p, %u, %p, %p)\n", - command_queue, - buffer, - data->mapped_ptr, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - ret_val=clEnqueueUnmapMemObject(command_queue, - buffer, - data->mapped_ptr, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - - -int test_clGetMemObjectInfo (const struct clGetMemObjectInfo_st *data) -{ - test_icd_app_log("clGetMemObjectInfo(%p, %u, %u, %p, %p)\n", - buffer, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - ret_val=clGetMemObjectInfo(buffer, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - test_icd_app_log("Value returned: %d\n",ret_val); - - return 0; -} - -int test_buffer_object() -{ - int i; - for (i=0; i -#include "param_struct.h" -#include - -extern cl_command_queue command_queue; - -cl_int ret_val; - -const struct clRetainCommandQueue_st clRetainCommandQueueData[NUM_ITEMS_clRetainCommandQueue] = { - {NULL} -}; - -const struct clGetCommandQueueInfo_st clGetCommandQueueInfoData[NUM_ITEMS_clGetCommandQueueInfo] = { - {NULL, 0, 0, NULL, NULL} -}; - -int test_clRetainCommandQueue(const struct clRetainCommandQueue_st *data) -{ - test_icd_app_log("clRetainCommandQueue(%p)\n", command_queue); - - ret_val = clRetainCommandQueue(command_queue); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -int test_clGetCommandQueueInfo(const struct clGetCommandQueueInfo_st *data) -{ - test_icd_app_log("clGetCommandQueueInfo(%p, %u, %u, %p, %p)\n", - command_queue, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - ret_val = clGetCommandQueueInfo(command_queue, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -int test_cl_runtime() -{ - int i; - - for (i=0; i -#include -#include -#include "param_struct.h" -#include - -extern cl_context context; -extern cl_mem buffer; -extern cl_command_queue command_queue; -extern cl_event event; -extern cl_context_properties context_properties[3]; -cl_int ret_val; -cl_mem ret_mem; - -struct clCreateFromGLBuffer_st clCreateFromGLBufferData[NUM_ITEMS_clCreateFromGLBuffer] = { - {NULL, 0x0, 0, NULL} -}; - -int test_clCreateFromGLBuffer(const struct clCreateFromGLBuffer_st* data) -{ - - test_icd_app_log("clCreateFromGLBuffer(%p, %x, %u, %p)\n", - context, - data->flags, - data->bufobj, - data->errcode_ret); - - ret_mem = clCreateFromGLBuffer(context, - data->flags, - data->bufobj, - data->errcode_ret); - - test_icd_app_log("Value returned: %p\n", ret_mem); - - return 0; -} - -struct clCreateFromGLTexture_st clCreateFromGLTextureData[NUM_ITEMS_clCreateFromGLTexture] = { - {NULL, 0x0, 0, 0, 0, NULL} -}; - -int test_clCreateFromGLTexture(const struct clCreateFromGLTexture_st* data) -{ - test_icd_app_log("clCreateFromGLTexture(%p, %x, %d, %d, %u, %p)\n", - context, - data->flags, - data->texture_target, - data->miplevel, - data->texture, - data->errcode_ret); - - ret_mem = clCreateFromGLTexture(context, - data->flags, - data->texture_target, - data->miplevel, - data->texture, - data->errcode_ret); - - test_icd_app_log("Value returned: %p\n", ret_mem); - - return 0; -} - -struct clCreateFromGLTexture2D_st clCreateFromGLTexture2DData[NUM_ITEMS_clCreateFromGLTexture2D] = { - {NULL, 0x0, 0, 0, 0, NULL} -}; - -int test_clCreateFromGLTexture2D(const struct clCreateFromGLTexture2D_st* data) -{ - test_icd_app_log("clCreateFromGLTexture2D(%p, %x, %d, %d, %u, %p)\n", - context, - data->flags, - data->texture_target, - data->miplevel, - data->texture, - data->errcode_ret); - - ret_mem = clCreateFromGLTexture2D(context, - data->flags, - data->texture_target, - data->miplevel, - data->texture, - data->errcode_ret); - - test_icd_app_log("Value returned: %p\n", ret_mem); - - return 0; -} - -struct clCreateFromGLTexture3D_st clCreateFromGLTexture3DData[NUM_ITEMS_clCreateFromGLTexture3D] = { - {NULL, 0, 0, 0, 0, NULL} -}; - -int test_clCreateFromGLTexture3D(const struct clCreateFromGLTexture3D_st* data) -{ - test_icd_app_log("clCreateFromGLTexture3D(%p, %x, %d, %d, %u, %p)\n", - context, - data->flags, - data->texture_target, - data->miplevel, - data->texture, - data->errcode_ret); - - ret_mem = clCreateFromGLTexture3D(context, - data->flags, - data->texture_target, - data->miplevel, - data->texture, - data->errcode_ret); - - test_icd_app_log("Value returned: %p\n", ret_mem); - - return 0; -} - -struct clCreateFromGLRenderbuffer_st clCreateFromGLRenderbufferData[NUM_ITEMS_clCreateFromGLRenderbuffer] = { - {NULL, 0x0, 0, NULL} -}; - -int test_clCreateFromGLRenderbuffer(const struct clCreateFromGLRenderbuffer_st* data) -{ - test_icd_app_log("clCreateFromGLRenderbuffer(%p, %x, %d, %p)\n", - context, - data->flags, - data->renderbuffer, - data->errcode_ret); - - ret_mem = clCreateFromGLRenderbuffer(context, - data->flags, - data->renderbuffer, - data->errcode_ret); - - test_icd_app_log("Value returned: %p\n", ret_mem); - - return 0; -} - -struct clGetGLObjectInfo_st clGetGLObjectInfoData[NUM_ITEMS_clGetGLObjectInfo] = { - {NULL, NULL, NULL} -}; - -int test_clGetGLObjectInfo(const struct clGetGLObjectInfo_st* data) -{ - test_icd_app_log("clGetGLObjectInfo(%p, %p, %p)\n", - buffer, - data->gl_object_type, - data->gl_object_name); - - ret_val = clGetGLObjectInfo(buffer, - data->gl_object_type, - data->gl_object_name); - - test_icd_app_log("Value returned: %p\n", ret_val); - -} - -struct clGetGLTextureInfo_st clGetGLTextureInfoData[NUM_ITEMS_clGetGLTextureInfo] = { - {NULL, 0, 0, NULL, NULL} -}; - -int test_clGetGLTextureInfo(const struct clGetGLTextureInfo_st* data) -{ - test_icd_app_log("clGetGLTextureInfo(%p, %u, %u, %p, %p)\n", - buffer, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - ret_val = clGetGLTextureInfo (buffer, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - test_icd_app_log("Value returned: %p\n", ret_val); - - return 0; -} - -struct clEnqueueAcquireGLObjects_st clEnqueueAcquireGLObjectsData[NUM_ITEMS_clEnqueueAcquireGLObjects] = { - {NULL, 0, NULL, 0, NULL, NULL} -}; - -int test_clEnqueueAcquireGLObjects(const struct clEnqueueAcquireGLObjects_st* data) -{ - test_icd_app_log("clEnqueueAcquireGLObjects(%p, %u, %p, %u, %p, %p)\n", - command_queue, - data->num_objects, - data->mem_objects, - data->num_events_in_wait_list, - &event, - &event); - - ret_val = clEnqueueAcquireGLObjects (command_queue, - data->num_objects, - data->mem_objects, - data->num_events_in_wait_list, - &event, - &event); - - test_icd_app_log("Value returned: %p\n", ret_val); - - return 0; -} - -struct clEnqueueReleaseGLObjects_st clEnqueueReleaseGLObjectsData[NUM_ITEMS_clEnqueueReleaseGLObjects] = { - {NULL, 0, NULL, 0, NULL, NULL} -}; - -int test_clEnqueueReleaseGLObjects(const struct clEnqueueReleaseGLObjects_st* data) -{ - test_icd_app_log("clEnqueueReleaseGLObjects(%p, %u, %p, %u, %p, %p)\n", - command_queue, - data->num_objects, - data->mem_objects, - data->num_events_in_wait_list, - &event, - &event); - - ret_val = clEnqueueReleaseGLObjects (command_queue, - data->num_objects, - data->mem_objects, - data->num_events_in_wait_list, - &event, - &event); - - - test_icd_app_log("Value returned: %p\n", ret_val); - - return 0; -} - -struct clCreateEventFromGLsyncKHR_st clCreateEventFromGLsyncKHRData[NUM_ITEMS_clCreateEventFromGLsyncKHR] = { - {NULL, NULL, NULL} -}; - -typedef CL_API_ENTRY cl_event -(CL_API_CALL *PFN_clCreateEventFromGLsyncKHR)(cl_context /* context */, - cl_GLsync /* cl_GLsync */, - cl_int * /* errcode_ret */); - -int test_clCreateEventFromGLsyncKHR(const struct clCreateEventFromGLsyncKHR_st* data) -{ cl_event ret_event; - PFN_clCreateEventFromGLsyncKHR pfn_clCreateEventFromGLsyncKHR = NULL; - - test_icd_app_log("clCreateEventFromGLsyncKHR(%p, %p, %p)\n", - context, - data->sync, - data->errcode_ret); - - pfn_clCreateEventFromGLsyncKHR = clGetExtensionFunctionAddress("clCreateEventFromGLsyncKHR"); - if (!pfn_clCreateEventFromGLsyncKHR) { - test_icd_app_log("clGetExtensionFunctionAddress failed!\n"); - return 1; - } - - ret_event = pfn_clCreateEventFromGLsyncKHR (context, - data->sync, - data->errcode_ret); - - test_icd_app_log("Value returned: %p\n", ret_event); - return 0; -} - -struct clGetGLContextInfoKHR_st clGetGLContextInfoKHRData[NUM_ITEMS_clGetGLContextInfoKHR] = { - {NULL, 0, 0, NULL, NULL} -}; - -typedef CL_API_ENTRY cl_int -(CL_API_CALL *PFN_clGetGLContextInfoKHR)(const cl_context_properties * /* properties */, - cl_gl_context_info /* param_name */, - size_t /* param_value_size */, - void * /* param_value */, - size_t * /* param_value_size_ret */); - -int test_clGetGLContextInfoKHR(const struct clGetGLContextInfoKHR_st* data) -{ - PFN_clGetGLContextInfoKHR pfn_clGetGLContextInfoKHR = NULL; - test_icd_app_log("clGetGLContextInfoKHR(%p, %u, %u, %p, %p)\n", - context_properties, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - pfn_clGetGLContextInfoKHR = clGetExtensionFunctionAddress("clGetGLContextInfoKHR"); - if (!pfn_clGetGLContextInfoKHR) { - test_icd_app_log("clGetExtensionFunctionAddress failed!\n"); - return 1; - } - - ret_val = pfn_clGetGLContextInfoKHR(context_properties, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - test_icd_app_log("Value returned: %p\n", ret_val); - return 0; - -} - -int test_OpenGL_share() -{ - int i; - - for(i=0;i - -#define CL_USE_DEPRECATED_OPENCL_1_0_APIS -#define CL_USE_DEPRECATED_OPENCL_1_1_APIS - -#include -#include "param_struct.h" -#include - -extern void CL_CALLBACK createcontext_callback(const char* a, const void* b, size_t c, void* d); - -cl_platform_id* all_platforms; -cl_platform_id platform; -cl_uint num_platforms; -cl_context context; -cl_command_queue command_queue; -cl_mem buffer; -cl_mem subBuffer; -cl_mem image; -cl_sampler sampler; -cl_program program; -cl_kernel kernel; -cl_event event; -cl_device_id devices; -cl_context_properties context_properties[3] = { - (cl_context_properties)CL_CONTEXT_PLATFORM, - 0, - 0, -}; - -const struct clGetDeviceIDs_st clGetDeviceIDsData[NUM_ITEMS_clGetDeviceIDs] = -{ - {NULL, 0, 1, NULL, NULL} -}; - -const struct clCreateSampler_st clCreateSamplerData[NUM_ITEMS_clCreateSampler] = -{ - {NULL, 0x0, 0, 0, NULL}, -}; - -const struct clCreateCommandQueue_st clCreateCommandQueueData[NUM_ITEMS_clCreateCommandQueue] = -{ - {NULL, NULL, 0, NULL} -}; - -const struct clCreateContext_st clCreateContextData[NUM_ITEMS_clCreateContext] = -{ - {NULL, 1, NULL, NULL, NULL, NULL} -}; - -const struct clCreateContextFromType_st clCreateContextFromTypeData[NUM_ITEMS_clCreateContextFromType] = -{ - {NULL, 0, createcontext_callback, NULL, NULL} -}; - -const struct clCreateBuffer_st clCreateBufferData[NUM_ITEMS_clCreateBuffer] = -{ - {NULL, 0, 0, NULL, NULL} -}; - -const struct clCreateSubBuffer_st clCreateSubBufferData[NUM_ITEMS_clCreateSubBuffer] = -{ - {NULL, 0, 0, NULL, NULL} -}; - -const struct clCreateImage_st clCreateImageData[NUM_ITEMS_clCreateImage] = -{ - { NULL, 0x0, NULL, NULL, NULL, NULL} -}; - -const struct clCreateImage2D_st clCreateImage2DData[NUM_ITEMS_clCreateImage2D] = -{ - { NULL, 0x0, NULL, 0, 0, 0, NULL, NULL} -}; - -const struct clCreateImage3D_st clCreateImage3DData[NUM_ITEMS_clCreateImage3D] = -{ - { NULL, 0x0, NULL, 0, 0, 0, 0, 0, NULL, NULL } -}; - - -struct clReleaseMemObject_st clReleaseMemObjectData[NUM_ITEMS_clReleaseMemObject] = -{ - {NULL} -}; - -struct clReleaseMemObject_st clReleaseMemObjectDataImage[NUM_ITEMS_clReleaseMemObject] = -{ - {NULL} -};const struct clCreateProgramWithSource_st clCreateProgramWithSourceData[NUM_ITEMS_clCreateProgramWithSource] = -{ - {NULL, 0, NULL, NULL, NULL} -}; - -const struct clCreateProgramWithBinary_st clCreateProgramWithBinaryData[NUM_ITEMS_clCreateProgramWithBinary] = -{ - {NULL, 0, NULL, NULL, NULL, NULL, NULL} -}; - -const struct clCreateProgramWithBuiltInKernels_st clCreateProgramWithBuiltInKernelsData[NUM_ITEMS_clCreateProgramWithBuiltInKernels] = -{ - {NULL, 0, NULL, NULL, NULL} -}; - -const struct clCreateKernel_st clCreateKernelData[NUM_ITEMS_clCreateKernel] = -{ - {NULL, NULL, NULL} -}; - -const struct clCreateKernelsInProgram_st clCreateKernelsInProgramData[NUM_ITEMS_clCreateKernelsInProgram] = -{ - {NULL, 0, NULL, NULL} -}; - -const struct clCreateUserEvent_st clCreateUserEventData[NUM_ITEMS_clCreateUserEvent] = -{ - {NULL, NULL} -}; - -const struct clGetPlatformIDs_st clGetPlatformIDsData[NUM_ITEMS_clGetPlatformIDs] = -{ - {0, NULL, 0} -}; - -/* - * Some log messages cause log mismatches when ICD loader calls a driver - * function while initializing platforms. The functions clGetPlatform* are most - * likely to be called at that time. But nothing stops an ICD loader from - * calling a ICD driver function anytime. - * - * FIXME: Figure out a good way to handle this. - */ -#define ENABLE_MISMATCHING_PRINTS 0 - -int test_clGetPlatformIDs(const struct clGetPlatformIDs_st* data) -{ - cl_int ret_val; - size_t param_val_ret_size; - #define PLATFORM_NAME_SIZE 40 - char platform_name[PLATFORM_NAME_SIZE]; - cl_uint i; - -#if ENABLE_MISMATCHING_PRINTS - test_icd_app_log("clGetPlatformIDs(%u, %p, %p)\n", - data->num_entries, - &platforms, - &num_platforms); -#endif - - ret_val = clGetPlatformIDs(0, - NULL, - &num_platforms); - - if (ret_val != CL_SUCCESS){ - return -1; - } - - all_platforms = (cl_platform_id *) malloc (num_platforms * sizeof(cl_platform_id)); - - ret_val = clGetPlatformIDs(num_platforms, - all_platforms, - NULL); - - if (ret_val != CL_SUCCESS){ - return -1; - } - - for (i = 0; i < num_platforms; i++) { - ret_val = clGetPlatformInfo(all_platforms[i], - CL_PLATFORM_NAME, - PLATFORM_NAME_SIZE, - (void*)platform_name, - ¶m_val_ret_size ); - - if (ret_val == CL_SUCCESS ){ - if(!strcmp(platform_name, "ICD_LOADER_TEST_OPENCL_STUB")) { - platform = all_platforms[i]; - } - } - } - -#if ENABLE_MISMATCHING_PRINTS - test_icd_app_log("Value returned: %d\n", ret_val); -#endif - - return 0; - -} - -int test_clGetDeviceIDs(const struct clGetDeviceIDs_st* data) -{ - int ret_val; - - test_icd_app_log("clGetDeviceIDs(%p, %x, %u, %p, %p)\n", - platform, - data->device_type, - data->num_entries, - &devices, - data->num_devices); - - ret_val = clGetDeviceIDs(platform, - data->device_type, - data->num_entries, - &devices, - data->num_devices); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -int test_clCreateContext(const struct clCreateContext_st* data) -{ - test_icd_app_log("clCreateContext(%p, %u, %p, %p, %p, %p)\n", - data->properties, - data->num_devices, - &devices, - &createcontext_callback, - data->user_data, - data->errcode_ret); - - context = clCreateContext(data->properties, - data->num_devices, - &devices, - &createcontext_callback, - data->user_data, - data->errcode_ret); - - test_icd_app_log("Value returned: %p\n", context); - - return 0; - -} - -int test_clCreateContextFromType(const struct clCreateContextFromType_st* data) -{ - test_icd_app_log("clCreateContextFromType(%p, %x, %p, %p, %p)\n", - context_properties, - data->device_type, - data->pfn_notify, - data->user_data, - data->errcode_ret); - - - context = clCreateContextFromType(context_properties, - data->device_type, - data->pfn_notify, - data->user_data, - data->errcode_ret); - - test_icd_app_log("Value returned: %p\n", context); - - return 0; - -} - -int test_clCreateCommandQueue(const struct clCreateCommandQueue_st *data) -{ - test_icd_app_log("clCreateCommandQueue(%p, %p, %x, %p)\n", - context, - devices, - data->properties, - data->errcode_ret); - - command_queue = clCreateCommandQueue(context, - devices, - data->properties, - data->errcode_ret); - - test_icd_app_log("Value returned: %p\n", command_queue); - - return 0; - -} - -int test_clCreateBuffer(const struct clCreateBuffer_st *data) -{ - test_icd_app_log("clCreateBuffer(%p, %x, %u, %p, %p)\n", - context, - data->flags, - data->size, - data->host_ptr, - data->errcode_ret); - - buffer = clCreateBuffer(context, - data->flags, - data->size, - data->host_ptr, - data->errcode_ret); - - clReleaseMemObjectData->memobj = buffer; - - test_icd_app_log("Value returned: %p\n", buffer); - - return 0; - -} - -int test_clCreateSubBuffer(const struct clCreateSubBuffer_st *data) -{ - test_icd_app_log("clCreateSubBuffer(%p, %x, %u, %p, %p)\n", - buffer, - data->flags, - data->buffer_create_type, - data->buffer_create_info, - data->errcode_ret); - - subBuffer = clCreateSubBuffer(buffer, - data->flags, - data->buffer_create_type, - data->buffer_create_info, - data->errcode_ret); - - clReleaseMemObjectData->memobj = buffer; - - test_icd_app_log("Value returned: %p\n", subBuffer); - - return 0; - -} - -int test_clCreateImage(const struct clCreateImage_st *data) -{ - test_icd_app_log("clCreateImage(%p, %x, %p, %p, %p, %p)\n", - context, - data->flags, - data->image_format, - data->image_desc, - data->host_ptr, - data->errcode_ret); - - image = clCreateImage(context, - data->flags, - data->image_format, - data->image_desc, - data->host_ptr, - data->errcode_ret); - - clReleaseMemObjectDataImage[0].memobj = image; - test_icd_app_log("Value returned: %p\n", image); - - return 0; - -} - -int test_clCreateImage2D(const struct clCreateImage2D_st *data) -{ - test_icd_app_log("clCreateImage2D(%p, %x, %p, %u, %u, %u, %p, %p)\n", - context, - data->flags, - data->image_format, - data->image_width, - data->image_height, - data->image_row_pitch, - data->host_ptr, - data->errcode_ret); - - image = clCreateImage2D(context, - data->flags, - data->image_format, - data->image_width, - data->image_height, - data->image_row_pitch, - data->host_ptr, - data->errcode_ret); - - clReleaseMemObjectDataImage[0].memobj = image; - test_icd_app_log("Value returned: %p\n", image); - - return 0; - -} - -int test_clCreateImage3D(const struct clCreateImage3D_st *data) -{ - test_icd_app_log("clCreateImage3D(%p, %x, %p, %u, %u, %u, %u, %u, %p, %p)\n", - context, - data->flags, - data->image_format, - data->image_width, - data->image_height, - data->image_depth, - data->image_row_pitch, - data->image_slice_pitch, - data->host_ptr, - data->errcode_ret); - - image = clCreateImage3D(context, - data->flags, - data->image_format, - data->image_width, - data->image_height, - data->image_depth, - data->image_row_pitch, - data->image_slice_pitch, - data->host_ptr, - data->errcode_ret); - - clReleaseMemObjectDataImage[0].memobj = image; - test_icd_app_log("Value returned: %p\n", image); - - return 0; - -} - -int test_clCreateSampler(const struct clCreateSampler_st *data) -{ - test_icd_app_log("clCreateSampler(%p, %u, %u, %u, %p)\n", - context, - data->normalized_coords, - data->addressing_mode, - data->filter_mode, - data->errcode_ret); - - sampler = clCreateSampler(context, - data->normalized_coords, - data->addressing_mode, - data->filter_mode, - data->errcode_ret); - - test_icd_app_log("Value returned: %p\n", sampler); - - return 0; - -} - -int test_clCreateProgramWithSource(const struct clCreateProgramWithSource_st *data) -{ - test_icd_app_log("clCreateProgramWithSource(%p, %u, %p, %p, %p)\n", - context, - data->count, - data->strings, - data->lengths, - data->errcode_ret); - - program = clCreateProgramWithSource(context, - data->count, - data->strings, - data->lengths, - data->errcode_ret); - - test_icd_app_log("Value returned: %p\n", program); - - return 0; - -} - -int test_clCreateProgramWithBinary(const struct clCreateProgramWithBinary_st *data) -{ - test_icd_app_log("clCreateProgramWithBinary(%p, %u, %p, %p, %p, %p, %p)\n", - context, - data->num_devices, - &devices, - data->lengths, - data->binaries, - data->binary_status, - data->errcode_ret); - - program = clCreateProgramWithBinary(context, - data->num_devices, - &devices, - data->lengths, - data->binaries, - data->binary_status, - data->errcode_ret); - - test_icd_app_log("Value returned: %p\n", program); - - return 0; - -} - -int test_clCreateProgramWithBuiltInKernels(const struct clCreateProgramWithBuiltInKernels_st *data) -{ - test_icd_app_log("clCreateProgramWithBuiltInKernels(%p, %u, %p, %p, %p)\n", - context, - data->num_devices, - &devices, - data->kernel_names, - data->errcode_ret); - - program = clCreateProgramWithBuiltInKernels(context, - data->num_devices, - &devices, - data->kernel_names, - data->errcode_ret); - - test_icd_app_log("Value returned: %p\n", program); - - return 0; - -} - -int test_clCreateKernel(const struct clCreateKernel_st* data) -{ - test_icd_app_log("clCreateKernel(%p, %p, %p)\n", - program, - data->kernel_name, - data->errcode_ret); - - kernel = clCreateKernel(program, - data->kernel_name, - data->errcode_ret); - - test_icd_app_log("Value returned: %p\n", kernel); - - return 0; - -} - -int test_clCreateKernelsInProgram(const struct clCreateKernelsInProgram_st* data) -{ - int ret_val; - test_icd_app_log("clCreateKernelsInProgram(%p, %u, %p, %p)\n", - program, - data->num_kernels, - &kernel, - data->num_kernels_ret); - - ret_val = clCreateKernelsInProgram(program, - data->num_kernels, - &kernel, - data->num_kernels_ret); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -int test_clCreateUserEvent(const struct clCreateUserEvent_st* data) -{ - test_icd_app_log("clCreateUserEvent(%p, %p)\n", - context, - data->errcode_ret); - - event = clCreateUserEvent(context, - data->errcode_ret); - - test_icd_app_log("Value returned: %p\n", event); - - return 0; - -} - -const struct clReleaseSampler_st clReleaseSamplerData[NUM_ITEMS_clReleaseSampler] = -{ - { NULL } -}; - -int test_clReleaseSampler(const struct clReleaseSampler_st *data) -{ - int ret_val = CL_OUT_OF_RESOURCES; - - test_icd_app_log("clReleaseSampler(%p)\n", sampler); - - ret_val = clReleaseSampler(sampler); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - - -int test_clReleaseMemObject(const struct clReleaseMemObject_st *data) -{ - int ret_val = -15; - test_icd_app_log("clReleaseMemObject(%p)\n", data->memobj); - - ret_val = clReleaseMemObject(data->memobj); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -const struct clReleaseEvent_st clReleaseEventData[NUM_ITEMS_clReleaseEvent] = -{ - {NULL} -}; - -int test_clReleaseEvent(const struct clReleaseEvent_st* data) -{ - int ret_val = CL_OUT_OF_RESOURCES; - - test_icd_app_log("clReleaseEvent(%p)\n", event); - - ret_val = clReleaseEvent(event); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -const struct clReleaseKernel_st clReleaseKernelData[NUM_ITEMS_clReleaseKernel] = -{ - {NULL} -}; - -int test_clReleaseKernel(const struct clReleaseKernel_st* data) -{ - int ret_val = CL_OUT_OF_RESOURCES; - - test_icd_app_log("clReleaseKernel(%p)\n", kernel); - - ret_val = clReleaseKernel(kernel); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -const struct clReleaseProgram_st clReleaseProgramData[NUM_ITEMS_clReleaseProgram] = -{ - {NULL} -}; - -int test_clReleaseProgram(const struct clReleaseProgram_st *data) -{ - int ret_val = CL_OUT_OF_RESOURCES; - - test_icd_app_log("clReleaseProgram(%p)\n", program); - - ret_val = clReleaseProgram(program); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -const struct clReleaseCommandQueue_st clReleaseCommandQueueData[NUM_ITEMS_clReleaseCommandQueue] = -{ - {NULL} -}; - -int test_clReleaseCommandQueue(const struct clReleaseCommandQueue_st *data) -{ - int ret_val = CL_OUT_OF_RESOURCES; - - test_icd_app_log("clReleaseCommandQueue(%p)\n", command_queue); - - ret_val = clReleaseCommandQueue(command_queue); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -const struct clReleaseContext_st clReleaseContextData[NUM_ITEMS_clReleaseContext] = -{ - {NULL} -}; - -int test_clReleaseContext(const struct clReleaseContext_st* data) -{ - int ret_val = CL_OUT_OF_RESOURCES; - - test_icd_app_log("clReleaseContext(%p)\n", context); - - ret_val = clReleaseContext(context); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -const struct clReleaseDevice_st clReleaseDeviceData[NUM_ITEMS_clReleaseDevice] = -{ - {NULL} -}; - -int test_clReleaseDevice(const struct clReleaseDevice_st* data) -{ - int ret_val = CL_OUT_OF_RESOURCES; - - test_icd_app_log("clReleaseDevice(%p)\n", devices); - - ret_val = clReleaseDevice(devices); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -int test_create_calls() -{ - test_clGetPlatformIDs(clGetPlatformIDsData); - - context_properties[1] = (cl_context_properties) platform; - - test_clGetDeviceIDs(clGetDeviceIDsData); - - test_clCreateContext(clCreateContextData); - - test_clReleaseContext(clReleaseContextData); - - test_clCreateContextFromType(clCreateContextFromTypeData); - - test_clCreateCommandQueue(clCreateCommandQueueData); - - test_clCreateBuffer(clCreateBufferData); - - test_clCreateSubBuffer(clCreateSubBufferData); - - test_clCreateImage(clCreateImageData); - - test_clReleaseMemObject(clReleaseMemObjectDataImage); - - test_clCreateImage2D(clCreateImage2DData); - - test_clReleaseMemObject(clReleaseMemObjectDataImage); - - test_clCreateImage3D(clCreateImage3DData); - - test_clCreateSampler(clCreateSamplerData); - - test_clCreateProgramWithSource(clCreateProgramWithSourceData); - - test_clReleaseProgram(clReleaseProgramData); - - test_clCreateProgramWithBinary(clCreateProgramWithBinaryData); - - test_clReleaseProgram(clReleaseProgramData); - - test_clCreateProgramWithBuiltInKernels(clCreateProgramWithBuiltInKernelsData); - - test_clCreateKernel(clCreateKernelData); - - test_clCreateKernelsInProgram(clCreateKernelsInProgramData); - - test_clCreateUserEvent(clCreateUserEventData); - - return 0; - -} - -int test_release_calls() -{ - test_clReleaseSampler(clReleaseSamplerData); - - test_clReleaseMemObject(clReleaseMemObjectData); - - test_clReleaseMemObject(clReleaseMemObjectDataImage); - - test_clReleaseEvent(clReleaseEventData); - - test_clReleaseKernel(clReleaseKernelData); - - test_clReleaseProgram(clReleaseProgramData); - - test_clReleaseCommandQueue(clReleaseCommandQueueData); - - test_clReleaseContext(clReleaseContextData); - - test_clReleaseDevice(clReleaseDeviceData); - - return 0; -} - diff --git a/khronos_icd/test/loader_test/test_image_objects.c b/khronos_icd/test/loader_test/test_image_objects.c deleted file mode 100644 index 0c47d1300..000000000 --- a/khronos_icd/test/loader_test/test_image_objects.c +++ /dev/null @@ -1,362 +0,0 @@ -#include -#include "param_struct.h" -#include - -extern cl_mem image; -extern cl_context context; -extern cl_command_queue command_queue; -extern cl_event event; -extern cl_mem buffer; - -int ret_val; - -const struct clGetSupportedImageFormats_st clGetSupportedImageFormatsData[NUM_ITEMS_clGetSupportedImageFormats] = -{ - { NULL, 0x0, 0, 0, NULL, NULL } -}; - -const struct clEnqueueCopyImageToBuffer_st clEnqueueCopyImageToBufferData[NUM_ITEMS_clEnqueueCopyImageToBuffer] = -{ - { NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL } -}; - -const struct clEnqueueCopyBufferToImage_st clEnqueueCopyBufferToImageData[NUM_ITEMS_clEnqueueCopyBufferToImage] = -{ - { NULL, NULL, NULL, 0, NULL, NULL, 0, NULL, NULL } -}; - -const struct clEnqueueMapImage_st clEnqueueMapImageData[NUM_ITEMS_clEnqueueMapImage] = -{ - { NULL, NULL, 0, 0x0, NULL, NULL, NULL, NULL,0, NULL, NULL} -}; - -const struct clEnqueueReadImage_st clEnqueueReadImageData[NUM_ITEMS_clEnqueueReadImage] = -{ - { NULL, NULL, 0, NULL, NULL, 0, 0, NULL, 0, NULL, NULL } -}; - -const struct clEnqueueWriteImage_st clEnqueueWriteImageData[NUM_ITEMS_clEnqueueWriteImage] = -{ - { NULL, NULL, 0, NULL, NULL, 0, 0, NULL, 0, NULL, NULL } -}; - -const struct clEnqueueFillImage_st clEnqueueFillImageData[NUM_ITEMS_clEnqueueFillImage] = -{ - { NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL } -}; - -const struct clEnqueueCopyImage_st clEnqueueCopyImageData[NUM_ITEMS_clEnqueueCopyImage] = -{ - { NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL } -}; - -const struct clGetImageInfo_st clGetImageInfoData[NUM_ITEMS_clGetImageInfo] = -{ - { NULL, 0, 0, NULL, NULL} -}; - -int test_clGetSupportedImageFormats(const struct clGetSupportedImageFormats_st *data) -{ - test_icd_app_log("clGetSupportedImageFormats(%p, %x, %u, %u, %p, %p)\n", - context, - data->flags, - data->image_type, - data->num_entries, - data->image_formats, - data->num_image_formats); - - ret_val = clGetSupportedImageFormats(context, - data->flags, - data->image_type, - data->num_entries, - data->image_formats, - data->num_image_formats); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -int test_clEnqueueCopyImageToBuffer(const struct clEnqueueCopyImageToBuffer_st *data) -{ - test_icd_app_log("clEnqueueCopyImageToBuffer(%p, %p, %p, %p, %p, %u, %u, %p, %p)\n", - command_queue, - image, - buffer, - data->src_origin, - data->region, - data->dst_offset, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - ret_val = clEnqueueCopyImageToBuffer(command_queue, - image, - buffer, - data->src_origin, - data->region, - data->dst_offset, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -int test_clEnqueueCopyBufferToImage(const struct clEnqueueCopyBufferToImage_st *data) -{ - test_icd_app_log("clEnqueueCopyBufferToImage(%p, %p, %p, %u, %p, %p, %u, %p, %p)\n", - command_queue, - buffer, - image, - data->src_offset, - data->dst_origin, - data->region, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - ret_val = clEnqueueCopyBufferToImage(command_queue, - buffer, - image, - data->src_offset, - data->dst_origin, - data->region, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -int test_clEnqueueMapImage(const struct clEnqueueMapImage_st *data) -{ - void *return_value; - test_icd_app_log("clEnqueueMapImage(%p, %p, %u, %x, %p, %p, %p, %p, %u, %p, %p, %p)\n", - command_queue, - image, - data->blocking_map, - data->map_flags, - data->origin, - data->region, - data->image_row_pitch, - data->image_slice_pitch, - data->num_events_in_wait_list, - data->event_wait_list, - &event, - data->errcode_ret); - - return_value = clEnqueueMapImage(command_queue, - image, - data->blocking_map, - data->map_flags, - data->origin, - data->region, - data->image_row_pitch, - data->image_slice_pitch, - data->num_events_in_wait_list, - data->event_wait_list, - &event, - data->errcode_ret); - - test_icd_app_log("Value returned: %p\n", return_value); - - free(return_value); - - return 0; - -} - -int test_clEnqueueReadImage(const struct clEnqueueReadImage_st *data) -{ - test_icd_app_log("clEnqueueReadImage(%p, %p, %u, %p, %p, %u, %u, %p, %u, %p, %p)\n", - command_queue, - image, - data->blocking_read, - data->origin, - data->region, - data->row_pitch, - data->slice_pitch, - data->ptr, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - ret_val = clEnqueueReadImage(command_queue, - image, - data->blocking_read, - data->origin, - data->region, - data->row_pitch, - data->slice_pitch, - data->ptr, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -int test_clEnqueueWriteImage(const struct clEnqueueWriteImage_st *data) -{ - test_icd_app_log("clEnqueueWriteImage(%p, %p, %u, %p, %p, %u, %u, %p, %u, %p, %p)\n", - command_queue, - image, - data->blocking_write, - data->origin, - data->region, - data->input_row_pitch, - data->input_slice_pitch, - data->ptr, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - ret_val = clEnqueueWriteImage(command_queue, - image, - data->blocking_write, - data->origin, - data->region, - data->input_row_pitch, - data->input_slice_pitch, - data->ptr, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -int test_clEnqueueFillImage(const struct clEnqueueFillImage_st *data) -{ - test_icd_app_log("clEnqueueFillImage(%p, %p, %p, %p, %p, %u, %p, %p)\n", - command_queue, - image, - data->fill_color, - data->origin, - data->region, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - ret_val = clEnqueueFillImage(command_queue, - image, - data->fill_color, - data->origin, - data->region, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} -int test_clEnqueueCopyImage(const struct clEnqueueCopyImage_st *data) -{ - test_icd_app_log("clEnqueueCopyImage(%p, %p, %p, %p, %p, %p, %u, %p, %p)\n", - command_queue, - image, - image, - data->src_origin, - data->dst_origin, - data->region, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - ret_val = clEnqueueCopyImage(command_queue, - image, - image, - data->src_origin, - data->dst_origin, - data->region, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - - -int test_clGetImageInfo(const struct clGetImageInfo_st *data) -{ - test_icd_app_log("clGetImageInfo(%p, %u, %u, %p, %p)\n", - image, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - ret_val = clGetImageInfo(image, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -int test_image_objects() -{ - int i; - - for (i = 0; i -#include "param_struct.h" -#include - -extern cl_kernel kernel; -extern cl_event event; -extern cl_context context; -extern cl_command_queue command_queue; -extern cl_device_id devices; -int ret_val; -extern void CL_CALLBACK setevent_callback(cl_event _a, cl_int _b, void* _c); -extern void CL_CALLBACK setprintf_callback(cl_context _a, cl_uint _b, char* _c, void* _d ); - -struct clRetainKernel_st clRetainKernelData[NUM_ITEMS_clRetainKernel] = -{ - {NULL} -}; - -int test_clRetainKernel(const struct clRetainKernel_st* data) -{ - test_icd_app_log("clRetainKernel(%p)\n", kernel); - - ret_val=clRetainKernel(kernel); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -struct clSetKernelArg_st clSetKernelArgData[NUM_ITEMS_clSetKernelArg] = -{ - {NULL, 0, 0, NULL} -}; - -int test_clSetKernelArg(const struct clSetKernelArg_st* data) -{ - test_icd_app_log("clSetKernelArg(%p, %u, %u, %p)\n", - kernel, - data->arg_index, - data->arg_size, - data->arg_value); - - ret_val=clSetKernelArg(kernel, - data->arg_index, - data->arg_size, - data->arg_value); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -struct clGetKernelInfo_st clGetKernelInfoData[NUM_ITEMS_clGetKernelInfo] = -{ - {NULL, 0, 0, NULL, NULL} -}; - -int test_clGetKernelInfo(const struct clGetKernelInfo_st* data) -{ - test_icd_app_log("clGetKernelInfo(%p, %u, %u, %p, %p)\n", - kernel, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - ret_val=clGetKernelInfo(kernel, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -struct clGetKernelArgInfo_st clGetKernelArgInfoData[NUM_ITEMS_clGetKernelArgInfo] = -{ - {NULL, 0, 0, 0, NULL, NULL} -}; - -int test_clGetKernelArgInfo(const struct clGetKernelArgInfo_st* data) -{ - test_icd_app_log("clGetKernelArgInfo(%p, %u, %u, %u, %p, %p)\n", - kernel, - data->arg_indx, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - ret_val=clGetKernelArgInfo(kernel, - data->arg_indx, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -struct clGetKernelWorkGroupInfo_st clGetKernelWorkGroupInfoData[NUM_ITEMS_clGetKernelWorkGroupInfo] = -{ - {NULL, NULL, 0, 0, NULL, NULL} -}; - -int test_clGetKernelWorkGroupInfo(const struct clGetKernelWorkGroupInfo_st* data) -{ - test_icd_app_log("clGetKernelWorkGroupInfo(%p, %p, %u, %u, %p, %p)\n", - kernel, - devices, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - ret_val=clGetKernelWorkGroupInfo(kernel, - devices, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -struct clEnqueueMigrateMemObjects_st clEnqueueMigrateMemObjectsData[NUM_ITEMS_clEnqueueMigrateMemObjects] = -{ - {NULL, 0, NULL, 0x0, 0, NULL, NULL} -}; - -int test_clEnqueueMigrateMemObjects(const struct clEnqueueMigrateMemObjects_st* data) -{ - test_icd_app_log("clEnqueueMigrateMemObjects(%p, %u, %p, %x, %u, %p, %p)\n", - command_queue, - data->num_mem_objects, - data->mem_objects, - data->flags, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - ret_val=clEnqueueMigrateMemObjects(command_queue, - data->num_mem_objects, - data->mem_objects, - data->flags, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -struct clEnqueueNDRangeKernel_st clEnqueueNDRangeKernelData[NUM_ITEMS_clEnqueueNDRangeKernel] = -{ - {NULL, NULL, 0, NULL, NULL, NULL, 0, NULL} -}; - -int test_clEnqueueNDRangeKernel(const struct clEnqueueNDRangeKernel_st* data) -{ - test_icd_app_log("clEnqueueNDRangeKernel(%p, %p, %u, %p, %p, %p, %u, %p, %p)\n", - command_queue, - kernel, - data->work_dim, - data->global_work_offset, - data->global_work_size, - data->local_work_size, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - ret_val=clEnqueueNDRangeKernel(command_queue, - kernel, - data->work_dim, - data->global_work_offset, - data->global_work_size, - data->local_work_size, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -struct clEnqueueTask_st clEnqueueTaskData[NUM_ITEMS_clEnqueueTask] = -{ - {NULL, NULL, 0, NULL, NULL} -}; - -int test_clEnqueueTask(const struct clEnqueueTask_st* data) -{ - test_icd_app_log("clEnqueueTask(%p, %p, %u, %p, %p)\n", - command_queue, - kernel, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - ret_val=clEnqueueTask(command_queue, - kernel, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} -struct clEnqueueNativeKernel_st clEnqueueNativeKernelData[NUM_ITEMS_clEnqueueNativeKernel] = -{ - {NULL, NULL, NULL, 0, 0, NULL, NULL, 0, NULL, NULL} -}; - -int test_clEnqueueNativeKernel(const struct clEnqueueNativeKernel_st* data) { - test_icd_app_log("clEnqueueNativeKernel(%p, %p, %p, %u, %u, %p, %p, %u, %p, %p)\n", - command_queue, - data->user_func, - data->args, - data->cb_args, - data->num_mem_objects, - data->mem_list, - data->args_mem_loc, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - ret_val=clEnqueueNativeKernel(command_queue, - data->user_func, - data->args, - data->cb_args, - data->num_mem_objects, - data->mem_list, - data->args_mem_loc, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - test_icd_app_log("Value returned: %d\n", ret_val); - return 0; -} - -struct clSetUserEventStatus_st clSetUserEventStatusData[NUM_ITEMS_clSetUserEventStatus] = -{ - {NULL, 0} -}; - -int test_clSetUserEventStatus(const struct clSetUserEventStatus_st* data) -{ - test_icd_app_log("clSetUserEventStatus(%p, %d)\n", - event, - data->execution_status); - - ret_val=clSetUserEventStatus(event, - data->execution_status); - - test_icd_app_log("Value returned: %d\n", ret_val); - return 0; -} - -struct clWaitForEvents_st clWaitForEventsData[NUM_ITEMS_clWaitForEvents] = -{ - {1, NULL} -}; - -int test_clWaitForEvents(const struct clWaitForEvents_st* data) -{ - test_icd_app_log("clWaitForEvents(%u, %p)\n", - data->num_events, - &event); - - ret_val=clWaitForEvents(data->num_events, - &event); - - test_icd_app_log("Value returned: %d\n", ret_val); - return 0; -} - -struct clGetEventInfo_st clGetEventInfoData[NUM_ITEMS_clGetEventInfo] = -{ - {NULL, 0, 0, NULL, NULL} -}; - -int test_clGetEventInfo(const struct clGetEventInfo_st* data){ - test_icd_app_log("clGetEventInfo(%p, %u, %u, %p, %p)\n", - event, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - ret_val=clGetEventInfo(event, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -struct clSetEventCallback_st clSetEventCallbackData[NUM_ITEMS_clSetEventCallback] = -{ - {NULL, 0, setevent_callback, NULL} -}; - -int test_clSetEventCallback(const struct clSetEventCallback_st* data) -{ - test_icd_app_log("clSetEventCallback(%p, %d, %p, %p)\n", - event, - data->command_exec_callback_type, - data->pfn_event_notify, - data->user_data); - - ret_val=clSetEventCallback(event, - data->command_exec_callback_type, - data->pfn_event_notify, - data->user_data); - - test_icd_app_log("Value returned: %d\n", ret_val); - return 0; -} - -struct clRetainEvent_st clRetainEventData[NUM_ITEMS_clRetainEvent] = -{ - {NULL} -}; - -int test_clRetainEvent(const struct clRetainEvent_st* data) -{ - test_icd_app_log("clRetainEvent(%p)\n", event); - - ret_val=clRetainEvent(event); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -struct clEnqueueMarker_st clEnqueueMarkerData[NUM_ITEMS_clEnqueueMarker] = -{ - {NULL, NULL} -}; - -int test_clEnqueueMarker(const struct clEnqueueMarker_st* data) -{ - test_icd_app_log("clEnqueueMarker(%p, %p)\n", command_queue, &event); - - ret_val = clEnqueueMarker(command_queue, &event); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -struct clEnqueueMarkerWithWaitList_st clEnqueueMarkerWithWaitListData[NUM_ITEMS_clEnqueueMarkerWithWaitList] = -{ - {NULL, 0, NULL, NULL} -}; - -int test_clEnqueueMarkerWithWaitList(const struct clEnqueueMarkerWithWaitList_st* data) -{ - test_icd_app_log("clEnqueueMarkerWithWaitList(%p, %u, %p, %p)\n", - command_queue, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - ret_val=clEnqueueMarkerWithWaitList(command_queue, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -struct clEnqueueBarrierWithWaitList_st clEnqueueBarrierWithWaitListData[NUM_ITEMS_clEnqueueBarrierWithWaitList] = -{ - {NULL, 0, NULL, NULL} -}; -int test_clEnqueueBarrierWithWaitList(const struct clEnqueueBarrierWithWaitList_st* data) -{ - test_icd_app_log("clEnqueueBarrierWithWaitList(%p, %u, %p, %p)\n", - command_queue, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - ret_val=clEnqueueBarrierWithWaitList(command_queue, - data->num_events_in_wait_list, - data->event_wait_list, - &event); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -struct clEnqueueWaitForEvents_st clEnqueueWaitForEventsData[NUM_ITEMS_clEnqueueWaitForEvents] = -{ - {NULL, 0, NULL} -}; - -int test_clEnqueueWaitForEvents(const struct clEnqueueWaitForEvents_st* data) -{ - test_icd_app_log("clEnqueueWaitForEvents(%p, %u, %p)\n", - command_queue, - data->num_events, - data->event_list); - - ret_val = clEnqueueWaitForEvents(command_queue, - data->num_events, - data->event_list); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -struct clEnqueueBarrier_st clEnqueueBarrierData[NUM_ITEMS_clEnqueueBarrier] = -{ - {NULL} -}; - -int test_clEnqueueBarrier(const struct clEnqueueBarrier_st* data) -{ - test_icd_app_log("clEnqueueBarrier(%p)\n", command_queue); - - ret_val = clEnqueueBarrier(command_queue); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} -struct clGetEventProfilingInfo_st clGetEventProfilingInfoData[NUM_ITEMS_clGetEventProfilingInfo] = -{ - {NULL, 0, 0, NULL, NULL} -}; - -int test_clGetEventProfilingInfo(const struct clGetEventProfilingInfo_st* data) -{ - test_icd_app_log("clGetEventProfilingInfo(%p, %u, %u, %p, %p)\n", - event, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - ret_val=clGetEventProfilingInfo(event, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -struct clFlush_st clFlushData[NUM_ITEMS_clFlush] = -{ - {NULL} -}; - -int test_clFlush(const struct clFlush_st* data) -{ - test_icd_app_log("clFlush(%p)\n", command_queue); - - ret_val=clFlush(command_queue); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -struct clFinish_st clFinishData[NUM_ITEMS_clFinish] = -{ - {NULL} -}; - -int test_clFinish(const struct clFinish_st* data) -{ - test_icd_app_log("clFinish(%p)\n", command_queue); - - ret_val=clFinish(command_queue); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -int test_kernel() -{ - int i; - - for (i=0; i -#include "param_struct.h" -#include - -extern cl_context context; - -extern cl_platform_id platform; - -extern cl_device_id devices; - -int ret_val; - -struct clRetainContext_st clRetainContextData[NUM_ITEMS_clRetainContext] = -{ - {NULL} -}; - -struct clGetContextInfo_st clGetContextInfoData[NUM_ITEMS_clGetContextInfo] = -{ - {NULL, 0, 0, NULL, NULL} -}; - - -struct clGetPlatformInfo_st clGetPlatformInfoData[NUM_ITEMS_clGetPlatformInfo] = -{ - {NULL, 0, 0, NULL, NULL} -}; - -struct clGetDeviceInfo_st clGetDeviceInfoData[NUM_ITEMS_clGetDeviceInfo] = -{ - {NULL, 0, 0, NULL, NULL} -}; - -struct clCreateSubDevices_st clCreateSubDevicesData[NUM_ITEMS_clCreateSubDevices] = -{ - {NULL, NULL, 0, NULL, NULL} -}; - - -struct clRetainDevice_st clRetainDeviceData[NUM_ITEMS_clRetainDevice] = -{ - {NULL} -}; - - -int test_clRetainContext(const struct clRetainContext_st* data) -{ - test_icd_app_log("clRetainContext(%p)\n", context); - - ret_val = clRetainContext(context); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - - - -int test_clGetContextInfo(const struct clGetContextInfo_st* data) -{ - test_icd_app_log("clGetContextInfo(%p, %u, %u, %p, %p)\n", - context, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - - ret_val = clGetContextInfo(context, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -int test_clGetPlatformInfo(const struct clGetPlatformInfo_st* data) -{ - test_icd_app_log("clGetPlatformInfo(%p, %u, %u, %p, %p)\n", - platform, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - ret_val = clGetPlatformInfo(platform, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -int test_clGetDeviceInfo(const struct clGetDeviceInfo_st* data) -{ - test_icd_app_log("clGetDeviceInfo(%p, %u, %u, %p, %p)\n", - devices, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - ret_val = clGetDeviceInfo(devices, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -int test_clCreateSubDevices(const struct clCreateSubDevices_st* data) -{ - test_icd_app_log("clCreateSubDevices(%p, %p, %u, %p, %p)\n", - devices, - data->properties, - data->num_entries, - &devices, - data->num_devices); - - ret_val = clCreateSubDevices(devices, - data->properties, - data->num_entries, - &devices, - data->num_devices); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -int test_clRetainDevice(const struct clRetainDevice_st* data) -{ - test_icd_app_log("clRetainDevice(%p)\n", devices); - - ret_val = clRetainDevice(devices); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -int test_platforms() -{ - int i; - - for (i = 0;i -#include "param_struct.h" -#include - -extern cl_context context; -extern cl_program program; -extern cl_platform_id platform; -extern cl_device_id devices; - -int ret_val; - -extern void CL_CALLBACK program_callback(cl_program _a, void* _b); - -const struct clRetainProgram_st clRetainProgramData[NUM_ITEMS_clRetainProgram]= -{ - {NULL} -}; - -const struct clBuildProgram_st clBuildProgramData[NUM_ITEMS_clBuildProgram]= -{ - {NULL,0,NULL,NULL,program_callback,NULL} -}; - -const struct clCompileProgram_st clCompileProgramData[NUM_ITEMS_clCompileProgram]= -{ - {NULL,0,NULL,NULL,0,NULL,NULL,program_callback,NULL} -}; - -const struct clLinkProgram_st clLinkProgramData[NUM_ITEMS_clLinkProgram]= -{ - {NULL,0,NULL,NULL,0,NULL,program_callback,NULL,NULL} -}; - -const struct clUnloadPlatformCompiler_st clUnloadPlatformCompilerData[NUM_ITEMS_clUnloadPlatformCompiler]= -{ - {NULL} -}; - -const struct clGetExtensionFunctionAddressForPlatform_st clGetExtensionFunctionAddressForPlatformData[NUM_ITEMS_clGetExtensionFunctionAddressForPlatform]= -{ - {NULL, ""} -}; - -const struct clGetProgramInfo_st clGetProgramInfoData[NUM_ITEMS_clGetProgramInfo]= -{ - {NULL,0,0,NULL,NULL} -}; - -const struct clGetProgramBuildInfo_st clGetProgramBuildInfoData[NUM_ITEMS_clGetProgramBuildInfo]= -{ - {NULL,NULL,0,0,NULL,NULL} -}; - -int test_clRetainProgram(const struct clRetainProgram_st *data) -{ - test_icd_app_log("clRetainProgram(%p)\n", - program); - - ret_val=clRetainProgram(program); - - test_icd_app_log("Value returned: %d\n", - ret_val); - - return 0; - -} - -int test_clBuildProgram(const struct clBuildProgram_st *data) -{ - test_icd_app_log("clBuildProgram(%p, %u, %p, %p, %p, %p)\n", - program, - data->num_devices, - &devices, - data->options, - data->pfn_notify, - data->user_data); - - ret_val=clBuildProgram(program, - data->num_devices, - &devices, - data->options, - data->pfn_notify, - data->user_data); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -int test_clCompileProgram(const struct clCompileProgram_st *data) -{ - test_icd_app_log("clCompileProgram(%p, %u, %p, %p, %u, %p, %p, %p)\n", - program, - data->num_devices, - &devices, - data->options, - data->num_input_headers, - data->header_include_names, - data->pfn_notify, - data->user_data); - - ret_val=clCompileProgram(program, - data->num_devices, - &devices, - data->options, - data->num_input_headers, - data->headers, - data->header_include_names, - data->pfn_notify, - data->user_data); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -int test_clLinkProgram(const struct clLinkProgram_st *data) -{ - cl_program program; - test_icd_app_log("clLinkProgram(%p, %u, %p, %p, %u, %p, %p, %p, %p)\n", - context, - data->num_devices, - data->device_list, - data->options, - data->num_input_programs, - data->input_programs, - data->pfn_notify, - data->user_data, - data->errcode_ret); - - program=clLinkProgram(context, - data->num_devices, - data->device_list, - data->options, - data->num_input_programs, - data->input_programs, - data->pfn_notify, - data->user_data, - data->errcode_ret); - - test_icd_app_log("Value returned: %p\n", program); - - return 0; - -} - -int test_clUnloadPlatformCompiler(const struct clUnloadPlatformCompiler_st *data) -{ - test_icd_app_log("clUnloadPlatformCompiler(%p)\n", platform); - - ret_val=clUnloadPlatformCompiler(platform); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -int test_clGetExtensionFunctionAddressForPlatform(const struct clGetExtensionFunctionAddressForPlatform_st *data) -{ - void *return_value; - test_icd_app_log("clGetExtensionFunctionAddressForPlatform(%p, %p)\n", - platform, - data->func_name); - - return_value=clGetExtensionFunctionAddressForPlatform(platform, - data->func_name); - - test_icd_app_log("Value returned: %p\n", return_value); - - return 0; - -} - -int test_clGetProgramInfo(const struct clGetProgramInfo_st *data) -{ - test_icd_app_log("clGetProgramInfo(%p, %u, %u, %p, %p)\n", - program, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - ret_val=clGetProgramInfo(program, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -int test_clGetProgramBuildInfo(const struct clGetProgramBuildInfo_st *data) -{ - test_icd_app_log("clGetProgramBuildInfo(%p, %p, %u, %u, %p, %p)\n", - program, - data->device, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - ret_val=clGetProgramBuildInfo(program, - data->device, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; - -} - -int test_program_objects() -{ - int i; - - for (i=0;i -#include "param_struct.h" -#include - -extern cl_sampler sampler; -int ret_val; - -const struct clRetainSampler_st clRetainSamplerData[NUM_ITEMS_clRetainSampler]= -{ - { NULL } -}; - -const struct clGetSamplerInfo_st clGetSamplerInfoData[NUM_ITEMS_clGetSamplerInfo]= -{ - { NULL, 0, 0, NULL, NULL } -}; - - -int test_clRetainSampler(const struct clRetainSampler_st *data) -{ - test_icd_app_log("clRetainSampler(%p)\n", sampler); - - ret_val=clRetainSampler(sampler); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -int test_clGetSamplerInfo(const struct clGetSamplerInfo_st *data) -{ - test_icd_app_log("clGetSamplerInfo(%p, %u, %u, %p, %p)\n", - sampler, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - ret_val=clGetSamplerInfo(sampler, - data->param_name, - data->param_value_size, - data->param_value, - data->param_value_size_ret); - - test_icd_app_log("Value returned: %d\n", ret_val); - - return 0; -} - -int test_sampler_objects() -{ - int i; - - for (i=0;i -#include -#include -#include -#include -#include - -#define APP_LOG_FILE "icd_test_app_log.txt" -#define STUB_LOG_FILE "icd_test_stub_log.txt" - -static FILE *app_log_file; -static FILE *stub_log_file; - -int test_icd_initialize_app_log(void) -{ - app_log_file = fopen(APP_LOG_FILE, "w"); - if (!app_log_file) { - printf("Unable to open file %s\n", APP_LOG_FILE); - return -1; - } -} - -void test_icd_close_app_log(void) -{ - fclose(app_log_file); -} - -void test_icd_app_log(const char *format, ...) -{ - va_list args; - va_start(args, format); - vfprintf(app_log_file, format, args); - va_end(args); -} - -int test_icd_initialize_stub_log(void) -{ - stub_log_file = fopen(STUB_LOG_FILE, "w"); - if (!stub_log_file) { - printf("Unable to open file %s\n", STUB_LOG_FILE); - return -1; - } -} - -void test_icd_close_stub_log(void) -{ - fclose(stub_log_file); -} - -void test_icd_stub_log(const char *format, ...) -{ - va_list args; - va_start(args, format); - vfprintf(stub_log_file, format, args); - va_end(args); -} - -static char *test_icd_get_log(const char *filename) -{ - struct stat statbuf; - FILE *fp; - char *source = NULL; - - fp = fopen(filename, "rb"); - - if (fp) { - size_t fsize = 0; - stat(filename, &statbuf); - fsize = statbuf.st_size; - source = (char *)malloc(fsize+1); // +1 for NULL terminator - if (source) { - if (fsize) { - if (fread(source, fsize, 1, fp) != 1) { - free(source); - source = NULL; - } else { - source[fsize] = '\0'; - } - } else { - // Don't fail when fsize = 0, just return empty string - source[fsize] = '\0'; - } - } - fclose(fp); - } - - return source; -} - -char *test_icd_get_app_log(void) -{ - return test_icd_get_log(APP_LOG_FILE); -} - -char *test_icd_get_stub_log(void) -{ - return test_icd_get_log(STUB_LOG_FILE); -}