Browse Source

Do not unload OpenCL programs when they haven't been loaded due to no worker (see r4310)

Samuel Thibault 13 years ago
parent
commit
0925502c69
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/drivers/opencl/driver_opencl_utils.c

+ 3 - 0
src/drivers/opencl/driver_opencl_utils.c

@@ -200,6 +200,9 @@ cl_int starpu_opencl_unload_opencl(struct starpu_opencl_program *opencl_programs
         unsigned int dev;
         unsigned int nb_devices;
 
+	if (!starpu_opencl_worker_get_count())
+		return CL_SUCCESS;
+
         nb_devices = _starpu_opencl_get_device_count();
         // Iterate over each device
         for(dev = 0; dev < nb_devices; dev ++) {