瀏覽代碼

fix STARPU_LIMIT_CPU_MEM behavior when hwloc is not enabled

Samuel Thibault 10 年之前
父節點
當前提交
aced8a4142
共有 1 個文件被更改,包括 1 次插入1 次删除
  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