Added support for hipMemcpy2DAsync in HIP/HCC

Change-Id: Ia4a8306f2dc1e33a81a7195ec29aef652fcccc4b
This commit is contained in:
Rahul Garg
2017-05-03 22:29:12 +05:30
parent c7958cbb8b
commit ec27c695c4
2 ha cambiato i file con 39 aggiunte e 0 eliminazioni
+18
Vedi File
@@ -793,6 +793,24 @@ hipError_t hipMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch,
return ihipLogStatus(e);
}
hipError_t hipMemcpy2D(void* dst, size_t dpitch, const void* src, size_t spitch,
size_t width, size_t height, hipMemcpyKind kind, hipStream_t stream) {
HIP_INIT_CMD_API(dst, dpitch, src, spitch, width, height, kind, stream);
if(width > dpitch || width > spitch)
return ihipLogStatus(hipErrorUnknown);
hipError_t e = hipSuccess;
try {
for(int i = 0; i < height; ++i) {
e = hip_internal::memcpyAsync((unsigned char*)dst + i*dpitch, (unsigned char*)src + i*spitch, width, kind,stream);
}
}
catch (ihipException ex) {
e = ex._code;
}
return ihipLogStatus(e);
}
hipError_t hipMemcpy2DToArray(hipArray* dst, size_t wOffset, size_t hOffset, const void* src,
size_t spitch, size_t width, size_t height, hipMemcpyKind kind) {