Explorar o código

Discard environment variable STARPU_LIMIT_GPU_MEM and define instead
STARPU_LIMIT_CUDA_MEM and STARPU_LIMIT_OPENCL_MEM

Nathalie Furmento %!s(int64=12) %!d(string=hai) anos
pai
achega
5a5e86e8cd

+ 2 - 0
ChangeLog

@@ -88,6 +88,8 @@ New features:
   * Implement a memory manager which checks the global amount of
     memory available on devices, and checks there is enough memory
     before doing an allocation on the device.
+  * Discard environment variable STARPU_LIMIT_GPU_MEM and define
+    instead STARPU_LIMIT_CUDA_MEM and STARPU_LIMIT_OPENCL_MEM
 
 Changes:
   * Fix the block filter functions.

+ 11 - 5
doc/chapters/configuration.texi

@@ -583,12 +583,18 @@ This variable specifies in which file the debugging output should be saved to.
 This variable specifies in which directory to save the trace generated if FxT is enabled. It needs to have a trailing '/' character.
 @end defvr
 
-@defvr {Environment variable} STARPU_LIMIT_GPU_MEM
+@defvr {Environment variable} STARPU_LIMIT_CUDA_MEM
 This variable specifies the maximum number of megabytes that should be
-available to the application on each GPUs. In case this value is smaller than
-the size of the memory of a GPU, StarPU pre-allocates a buffer to waste memory
-on the device. This variable is intended to be used for experimental purposes
-as it emulates devices that have a limited amount of memory.
+available to the application on each CUDA devices. This variable is
+intended to be used for experimental purposes as it emulates devices
+that have a limited amount of memory.
+@end defvr
+
+@defvr {Environment variable} STARPU_LIMIT_OPENCL_MEM
+This variable specifies the maximum number of megabytes that should be
+available to the application on each OpenCL devices. This variable is
+intended to be used for experimental purposes as it emulates devices
+that have a limited amount of memory.
 @end defvr
 
 @defvr {Environment variable} STARPU_GENERATE_TRACE

+ 2 - 2
src/drivers/cuda/driver_cuda.c

@@ -67,14 +67,14 @@ _starpu_cuda_discover_devices (struct _starpu_machine_config *config)
 #ifdef STARPU_USE_CUDA
 #ifndef STARPU_SIMGRID
 /* In case we want to cap the amount of memory available on the GPUs by the
- * mean of the STARPU_LIMIT_GPU_MEM, we decrease the value of
+ * mean of the STARPU_LIMIT_CUDA_MEM, we decrease the value of
  * props[devid].totalGlobalMem which is the value returned by
  * starpu_cuda_get_global_mem_size() to indicate how much memory can
  * be allocated on the device
  */
 static void _starpu_cuda_limit_gpu_mem_if_needed(unsigned devid)
 {
-	int limit = starpu_get_env_number("STARPU_LIMIT_GPU_MEM");
+	int limit = starpu_get_env_number("STARPU_LIMIT_CUDA_MEM");
 
 	if (limit == -1)
 	{

+ 2 - 2
src/drivers/opencl/driver_opencl.c

@@ -60,7 +60,7 @@ _starpu_opencl_discover_devices(struct _starpu_machine_config *config)
 #ifdef STARPU_USE_OPENCL
 #ifndef STARPU_SIMGRID
 /* In case we want to cap the amount of memory available on the GPUs by the
- * mean of the STARPU_LIMIT_GPU_MEM, we allocate a big buffer when the driver
+ * mean of the STARPU_LIMIT_OPENCL_MEM, we allocate a big buffer when the driver
  * is launched. */
 static cl_mem wasted_memory[STARPU_MAXOPENCLDEVS];
 
@@ -68,7 +68,7 @@ static void limit_gpu_mem_if_needed(int devid)
 {
 	cl_int err;
 
-	int limit = starpu_get_env_number("STARPU_LIMIT_GPU_MEM");
+	int limit = starpu_get_env_number("STARPU_LIMIT_OPENCL_MEM");
 	if (limit == -1)
 	{
 		wasted_memory[devid] = NULL;