Browse Source

Fix getting global memory size into using the standard size for this

Samuel Thibault 10 years ago
parent
commit
c0ece14e0d
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/drivers/opencl/driver_opencl.c

+ 3 - 1
src/drivers/opencl/driver_opencl.c

@@ -82,9 +82,11 @@ static void _starpu_opencl_limit_gpu_mem_if_needed(unsigned devid)
 #elif defined(STARPU_USE_OPENCL)
 	/* Request the size of the current device's memory */
 	cl_int err;
-	err = clGetDeviceInfo(devices[devid], CL_DEVICE_GLOBAL_MEM_SIZE, sizeof(totalGlobalMem), &totalGlobalMem, NULL);
+	cl_ulong size;
+	err = clGetDeviceInfo(devices[devid], CL_DEVICE_GLOBAL_MEM_SIZE, sizeof(size), &size, NULL);
 	if (STARPU_UNLIKELY(err != CL_SUCCESS))
 		STARPU_OPENCL_REPORT_ERROR(err);
+	totalGlobalMem = size;
 #endif
 
 	limit = starpu_get_env_number("STARPU_LIMIT_OPENCL_MEM");