소스 검색

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 년 전
부모
커밋
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.