fix hipMempcy precondition, test for zero size first (#1697)

Этот коммит содержится в:
Jeff Daily
2019-11-25 19:03:03 -08:00
коммит произвёл Rahul Garg
родитель 306d50291e
Коммит 6df73e1f12
+2 -2
Просмотреть файл
@@ -354,8 +354,8 @@ void memcpy_impl(void* __restrict dst, const void* __restrict src, size_t n,
hipError_t memcpyAsync(void* dst, const void* src, size_t sizeBytes,
hipMemcpyKind kind, hipStream_t stream) {
if (!dst || !src) return hipErrorInvalidValue;
if (sizeBytes == 0) return hipSuccess;
if (!dst || !src) return hipErrorInvalidValue;
try {
stream = ihipSyncAndResolveStream(stream);
@@ -380,8 +380,8 @@ hipError_t memcpyAsync(void* dst, const void* src, size_t sizeBytes,
hipError_t memcpySync(void* dst, const void* src, size_t sizeBytes,
hipMemcpyKind kind, hipStream_t stream) {
if (!dst || !src) return hipErrorInvalidValue;
if (sizeBytes == 0) return hipSuccess;
if (!dst || !src) return hipErrorInvalidValue;
try {
stream = ihipSyncAndResolveStream(stream);