소스 검색

In case it is not allowed to allocate memory, don't try to do so.

Cédric Augonnet 15 년 전
부모
커밋
6d57183a8f
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      src/datawizard/copy_driver.c

+ 4 - 4
src/datawizard/copy_driver.c

@@ -222,9 +222,12 @@ int __attribute__((warn_unused_result)) _starpu_driver_copy_data_1_to_1(starpu_d
 	/* first make sure the destination has an allocated buffer */
 	if (!dst_replicate->allocated)
 	{
+		if (!may_alloc)
+			return -ENOMEM;
+
 		ret_alloc = _starpu_allocate_memory_on_node(handle, dst_replicate);
 		if (ret_alloc)
-			goto nomem;
+			return -ENOMEM;
 	}
 
 	STARPU_ASSERT(dst_replicate->allocated);
@@ -262,9 +265,6 @@ int __attribute__((warn_unused_result)) _starpu_driver_copy_data_1_to_1(starpu_d
 	}
 
 	return 0;
-
-nomem:
-	return -ENOMEM;
 }
 
 void _starpu_driver_wait_request_completion(starpu_async_channel *async_channel __attribute__ ((unused)),