浏览代码

socl/examples/matmul/matmul.c: do not use the check() macro with an argument of type cl_int: it is meant to be used with a call to an OpenCL function.

Calling check(err) could lead to the following code to be compiled:

	cl_int err = err;

which is obviously wrong.
Cyril Roelandt 12 年之前
父节点
当前提交
e85ffc2fa5
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      socl/examples/matmul/matmul.c

+ 4 - 1
socl/examples/matmul/matmul.c

@@ -244,7 +244,10 @@ int main(int argc, const char** argv) {
 		     printf("No OpenCL device found\n");
 		     exit(77);
 		}
-		check(err);
+		if (err != CL_SUCCESS) {
+			fprintf(stderr, "OpenCL Error (%d) in clGetDeviceIDs()\n", err);
+			exit(EXIT_FAILURE);
+		}
 		if (devs[p] == 0)
 			continue;