Explorar o código

fix STARPU_LIMIT_CPU_MEM behavior when hwloc is not enabled

Samuel Thibault %!s(int64=10) %!d(string=hai) anos
pai
achega
aced8a4142
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/drivers/cpu/driver_cpu.c

+ 1 - 1
src/drivers/cpu/driver_cpu.c

@@ -170,7 +170,7 @@ static size_t _starpu_cpu_get_global_mem_size(int nodeid STARPU_ATTRIBUTE_UNUSED
 	if (limit < 0)
 		// No limit is defined, we return the global memory size
 		return global_mem;
-	else if ((size_t)limit * 1024*1024 > global_mem)
+	else if (global_mem && (size_t)limit * 1024*1024 > global_mem)
 		// The requested limit is higher than what is available, we return the global memory size
 		return global_mem;
 	else