From bf4256f87016affbbe0381d7a83574e2c7956a22 Mon Sep 17 00:00:00 2001 From: Wilson Fung Date: Fri, 12 Apr 2013 05:50:15 -0800 Subject: Fix for bug 51 and 55: Declaration of clCreateContextFromType() is updated to match OpenCL 1.1 and later. The API call now accepts device types besides CL_DEVICE_TYPE_GPU. [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 15796] --- libopencl/opencl_runtime_api.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'libopencl') diff --git a/libopencl/opencl_runtime_api.cc b/libopencl/opencl_runtime_api.cc index 630c491..49fc0ff 100644 --- a/libopencl/opencl_runtime_api.cc +++ b/libopencl/opencl_runtime_api.cc @@ -670,16 +670,24 @@ void opencl_not_finished( const char* func, unsigned line ) } extern CL_API_ENTRY cl_context CL_API_CALL -clCreateContextFromType(cl_context_properties * properties, - cl_ulong device_type, +clCreateContextFromType(const cl_context_properties * properties, + cl_device_type device_type, void (*pfn_notify)(const char *, const void *, size_t, void *), void * user_data, cl_int * errcode_ret) CL_API_SUFFIX__VERSION_1_0 { _cl_device_id *gpu = GPGPUSim_Init(); - if( device_type != CL_DEVICE_TYPE_GPU ) { + + switch (device_type) { + case CL_DEVICE_TYPE_GPU: + case CL_DEVICE_TYPE_ACCELERATOR: + case CL_DEVICE_TYPE_DEFAULT: + case CL_DEVICE_TYPE_ALL: + break; // GPGPU-Sim qualifies as these types of device. + default: printf("GPGPU-Sim OpenCL API: unsupported device type %lx\n", device_type ); exit(1); + break; } if( properties != NULL ) { -- cgit v1.3