From: Zhigang Gong Date: Wed, 10 Apr 2013 11:23:41 +0000 (+0800) Subject: Fixed the extension string for both platform and device. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dad2c6773fb46902029f6af018ce666495871b75;p=contrib%2Fbeignet.git Fixed the extension string for both platform and device. I forgot to calculate the extensions string size. Now fix it. And also forgot to handle the device's extension case, now add it and duplicate the extensions from the platform directly. Signed-off-by: Zhigang Gong Tested-by: Lu, Guanqun --- diff --git a/src/cl_device_id.c b/src/cl_device_id.c index 4543921..8d47aa5 100644 --- a/src/cl_device_id.c +++ b/src/cl_device_id.c @@ -117,6 +117,9 @@ cl_get_device_ids(cl_platform_id platform, if (devices && UNLIKELY((*devices = cl_get_gt_device()) != NULL)) { if (num_devices) *num_devices = 1; + + (*devices)->extensions = intel_platform->extensions; + (*devices)->extensions_sz = intel_platform->extensions_sz; return CL_SUCCESS; } else { @@ -171,6 +174,7 @@ cl_get_device_info(cl_device_id device, GET_STRING_FIELD_SIZE(VERSION, version) GET_STRING_FIELD_SIZE(PROFILE, profile) GET_STRING_FIELD_SIZE(OPENCL_C_VERSION, opencl_c_version) + GET_STRING_FIELD_SIZE(EXTENSIONS, extensions) default: return CL_INVALID_VALUE; } } @@ -235,6 +239,7 @@ cl_get_device_info(cl_device_id device, DECL_STRING_FIELD(VERSION, version) DECL_STRING_FIELD(PROFILE, profile) DECL_STRING_FIELD(OPENCL_C_VERSION, opencl_c_version) + DECL_STRING_FIELD(EXTENSIONS, extensions); default: return CL_INVALID_VALUE; }; } diff --git a/src/cl_platform_id.c b/src/cl_platform_id.c index 900da3e..0d46453 100644 --- a/src/cl_platform_id.c +++ b/src/cl_platform_id.c @@ -64,6 +64,7 @@ cl_get_platform_ids(cl_uint num_entries, cl_intel_platform_extension_init(intel_platform); /* Easy right now, only one platform is supported */ *platforms = intel_platform; + intel_platform->extensions_sz = strlen(intel_platform->extensions) + 1; return CL_SUCCESS; }