[Beignet] [PATCH] API: Fix device type bugs
Xiuli Pan
xiuli.pan at intel.com
Fri Feb 10 07:04:17 UTC 2017
From: Pan Xiuli <xiuli.pan at intel.com>
Beignet only support GPU now, we should return CL_INVALID_DEVICE_TYPE
for CPU and ACCELERATOR.
Contributor: Giuseppe Bilotta <giuseppe.bilotta at gmail.com>
Signed-off-by: Pan Xiuli <xiuli.pan at intel.com>
---
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
More information about the Beignet
mailing list