Runtime: fix the incorrect platform info size (conformance).
authorZhigang Gong <zhigang.gong@linux.intel.com>
Wed, 28 Aug 2013 08:53:36 +0000 (16:53 +0800)
committerZhigang Gong <zhigang.gong@linux.intel.com>
Fri, 30 Aug 2013 08:40:08 +0000 (16:40 +0800)
As sizeof(str) already includes the '\0', we should not add 1
on the return size. Conformance case computeinfo could pass with
this patch.

(28-Aug 16:51:00)     BEGIN  Compute Info                            :
           ==>  CL_DEVICE_ERROR_CORRECTION_SUPPORT == 0
           ==>  CL_DEVICE_ERROR_CORRECTION_SUPPORT == 0
           ==>  CL_DEVICE_ERROR_CORRECTION_SUPPORT == 0
               PASSED computeinfo.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
src/cl_platform_id.c

index 33915ce..fdf0d78 100644 (file)
@@ -28,7 +28,7 @@
 
 #define DECL_INFO_STRING(FIELD, STRING) \
     .FIELD = STRING,                    \
-    .JOIN(FIELD,_sz) = sizeof(STRING) + 1,
+    .JOIN(FIELD,_sz) = sizeof(STRING),
 
 static struct _cl_platform_id intel_platform_data = {
   INIT_ICD(dispatch)