summaryrefslogtreecommitdiff
path: root/libopencl
diff options
context:
space:
mode:
authorWilson Fung <[email protected]>2013-04-12 05:50:15 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:50:46 -0700
commitbf4256f87016affbbe0381d7a83574e2c7956a22 (patch)
treee782fdb5397a48d02fb0013473e5dfb11d3adaa9 /libopencl
parent60395146cd0abe740f98d8e38c50691af94827ed (diff)
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]
Diffstat (limited to 'libopencl')
-rw-r--r--libopencl/opencl_runtime_api.cc14
1 files changed, 11 insertions, 3 deletions
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 ) {