summaryrefslogtreecommitdiff
path: root/libopencl/opencl_runtime_api.cc
diff options
context:
space:
mode:
authorAhmed El-Shafiey <[email protected]>2013-04-27 13:55:38 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:50:47 -0700
commit171da970465ce160f37fcb0202030fdcaaadd414 (patch)
tree0fbd99ec1ba8ad71778194fc5519e6277155b7a2 /libopencl/opencl_runtime_api.cc
parente3f98ac307226942862182077b90bf3809e7ce3a (diff)
Two small fixes in the OpenCL API
Review ID: 27001 [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 15969]
Diffstat (limited to 'libopencl/opencl_runtime_api.cc')
-rw-r--r--libopencl/opencl_runtime_api.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/libopencl/opencl_runtime_api.cc b/libopencl/opencl_runtime_api.cc
index bb350bd..4d9e380 100644
--- a/libopencl/opencl_runtime_api.cc
+++ b/libopencl/opencl_runtime_api.cc
@@ -596,8 +596,10 @@ cl_kernel _cl_program::CreateKernel( const char *kernel_name, cl_int *errcode_re
if( finfo == NULL )
setErrCode( errcode_ret, CL_INVALID_PROGRAM_EXECUTABLE );
- else
+ else{
result = new _cl_kernel(this,kernel_name,finfo);
+ *errcode_ret = CL_SUCCESS;
+ }
return result;
}
@@ -686,8 +688,8 @@ clCreateContextFromType(const cl_context_properties * properties,
break; // GPGPU-Sim qualifies as these types of device.
default:
printf("GPGPU-Sim OpenCL API: unsupported device type %lx\n", device_type );
- abort();
- break;
+ setErrCode( errcode_ret, CL_DEVICE_NOT_FOUND );
+ return NULL;
}
if( properties != NULL ) {
@@ -1104,7 +1106,9 @@ clGetDeviceIDs(cl_platform_id platform,
switch( device_type ) {
case CL_DEVICE_TYPE_CPU:
- opencl_not_implemented(__my_func__,__LINE__);
+ // Some benchmarks (e.g. ComD benchmark from Mantevo package) looks for CPU and GPU to choose among, so it is not wise to abort execution because of GPGPUsim is not a CPU !.
+ printf("GPGPU-Sim OpenCL API: unsupported device type %lx\n", device_type );
+ return CL_DEVICE_NOT_FOUND;
break;
case CL_DEVICE_TYPE_DEFAULT:
case CL_DEVICE_TYPE_GPU: