Skip to content

Commit ccf00a2

Browse files
committed
Fix bugs in the OpenCL backend.
1 parent d52f9c1 commit ccf00a2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎src/gpuarray_buffer_opencl.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ static int cl_callkernel(gpukernel *k, unsigned int n,
904904
break;
905905
case GA_SSIZE:
906906
stemp = *((ssize_t *)args[i]);
907-
ctx->err = clSetKernelArg(k->k, i, gpuarray_get_elsize(GA_LONG), &temp);
907+
ctx->err = clSetKernelArg(k->k, i, gpuarray_get_elsize(GA_LONG), &stemp);
908908
break;
909909
default:
910910
ctx->err = clSetKernelArg(k->k, i, gpuarray_get_elsize(k->types[i]),
@@ -1293,7 +1293,7 @@ static int cl_property(void *c, gpudata *buf, gpukernel *k, int prop_id,
12931293
&id, NULL);
12941294
if (ctx->err != GA_NO_ERROR)
12951295
return GA_IMPL_ERROR;
1296-
#ifdef OPENCL_1_1
1296+
#ifdef CL_VERSION_1_1
12971297
ctx->err = clGetKernelWorkGroupInfo(k->k, id,
12981298
CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE,
12991299
sizeof(sz), &sz, NULL);
@@ -1312,7 +1312,7 @@ static int cl_property(void *c, gpudata *buf, gpukernel *k, int prop_id,
13121312
13131313
Also OpenCL 1.0 kind of sucks and this is only used for that.
13141314
*/
1315-
sz = (64 < sz) ? 64 : sz;
1315+
sz = (sz < 64) ? sz : 64;
13161316
#endif
13171317
*((size_t *)res) = sz;
13181318
return GA_NO_ERROR;

0 commit comments

Comments
 (0)