From: Pan Xiuli <[email protected]> Beignet only support GPU now, we should return CL_INVALID_DEVICE_TYPE for CPU and ACCELERATOR. Contributor: Giuseppe Bilotta <[email protected]>
Signed-off-by: Pan Xiuli <[email protected]> --- src/cl_api_context.c | 3 +-- src/cl_api_device_id.c | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/cl_api_context.c b/src/cl_api_context.c index e8184b1..85d6480 100644 --- a/src/cl_api_context.c +++ b/src/cl_api_context.c @@ -71,8 +71,7 @@ clCreateContextFromType(const cl_context_properties *properties, cl_int err = CL_SUCCESS; cl_device_id *devices = NULL; cl_uint num_devices = 0; - const cl_device_type valid_type = CL_DEVICE_TYPE_GPU | CL_DEVICE_TYPE_CPU | CL_DEVICE_TYPE_ACCELERATOR | - CL_DEVICE_TYPE_DEFAULT | CL_DEVICE_TYPE_CUSTOM; + const cl_device_type valid_type = CL_DEVICE_TYPE_GPU | CL_DEVICE_TYPE_DEFAULT | CL_DEVICE_TYPE_CUSTOM; do { /* Assure parameters correctness */ diff --git a/src/cl_api_device_id.c b/src/cl_api_device_id.c index 4ffef78..84e0882 100644 --- a/src/cl_api_device_id.c +++ b/src/cl_api_device_id.c @@ -26,9 +26,7 @@ clGetDeviceIDs(cl_platform_id platform, cl_device_id *devices, cl_uint *num_devices) { - const cl_device_type valid_type = CL_DEVICE_TYPE_GPU | CL_DEVICE_TYPE_CPU | - CL_DEVICE_TYPE_ACCELERATOR | CL_DEVICE_TYPE_DEFAULT | - CL_DEVICE_TYPE_CUSTOM; + const cl_device_type valid_type = CL_DEVICE_TYPE_GPU | CL_DEVICE_TYPE_DEFAULT | CL_DEVICE_TYPE_CUSTOM; /* Check parameter consistency */ if (UNLIKELY(devices == NULL && num_devices == NULL)) -- 2.7.4 _______________________________________________ Beignet mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/beignet
