Просмотр исходного кода

When NCUDA is not specified it takes value "-1", but this part of the code should not be executed in any case (unless I am missing something)

Problem detected in SimGrid execution, where time to allocate memory for CUDA was taken into account even when GPUs are not used
Luka Stanisic лет назад: 8
Родитель
Сommit
0e9e4ea1ea
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/datawizard/malloc.c

+ 1 - 1
src/datawizard/malloc.c

@@ -139,7 +139,7 @@ int starpu_malloc_flags(void **A, size_t dim, int flags)
 	}
 
 	struct _starpu_machine_config *config = _starpu_get_machine_config();
-	if (flags & STARPU_MALLOC_PINNED && disable_pinning <= 0 && STARPU_RUNNING_ON_VALGRIND == 0 && config->conf.ncuda != 0)
+	if (flags & STARPU_MALLOC_PINNED && disable_pinning <= 0 && STARPU_RUNNING_ON_VALGRIND == 0 && config->conf.ncuda > 0)
 	{
 #ifdef STARPU_SIMGRID
 		/* FIXME: CUDA seems to be taking 650µs every 1MiB.