summaryrefslogtreecommitdiff
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
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]
-rw-r--r--CHANGES5
-rw-r--r--libopencl/opencl_runtime_api.cc14
2 files changed, 16 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index 4af4c15..573fe37 100644
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,11 @@ Version 3.2.1+edits (development branch) versus 3.2.1
- Replaced legacy L2 cache access statistics with more meaningful breakdown.
- Bug Fixes:
- Fixed the flit count sent to GPUWattch for atomic operations.
+ - Fix for Bug 51 - Updated the function declaration of
+ clCreateContextFromType().
+ - Fix for Bug 55 - clCreateContextFromType() now accepts device type
+ CL_DEVICE_TYPE_ALL, CL_DEVICE_TYPE_ACCELERATOR, CL_DEVICE_TYPE_DEFAULT
+ and CL_DEVICE_TYPE_GPU. Before only CL_DEVICE_TYPE_GPU is accepted.
Version 3.2.1 versus 3.2.0
- Added kernel name and launch uids to performance statistics log.
- Added l2_cache_config class to extend baseline cache_config. Allows for
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 ) {