@@ -2115,8 +2115,9 @@ void ihipStream_t::locked_copySync(void* dst, const void* src, size_t sizeBytes,
|
||||
}
|
||||
}
|
||||
|
||||
void ihipStream_t::locked_copy2DSync(void* dst, const void* src, size_t width, size_t height, size_t srcPitch, size_t dstPitch, unsigned kind,
|
||||
bool ihipStream_t::locked_copy2DSync(void* dst, const void* src, size_t width, size_t height, size_t srcPitch, size_t dstPitch, unsigned kind,
|
||||
bool resolveOn) {
|
||||
bool retStatus = true;
|
||||
ihipCtx_t* ctx = this->getCtx();
|
||||
const ihipDevice_t* device = ctx->getDevice();
|
||||
|
||||
@@ -2161,11 +2162,20 @@ void ihipStream_t::locked_copy2DSync(void* dst, const void* src, size_t width, s
|
||||
sizeBytes, hcMemcpyStr(hcCopyDir), forceUnpinnedCopy);
|
||||
printPointerInfo(DB_COPY, " dst", dst, dstPtrInfo);
|
||||
printPointerInfo(DB_COPY, " src", src, srcPtrInfo);
|
||||
|
||||
#if (__hcc_workweek__ >= 19062)
|
||||
if(!crit->_av.copy2d_ext(src, dst, width, height, srcPitch, dstPitch, hcCopyDir, srcPtrInfo, dstPtrInfo,
|
||||
copyDevice ? ©Device->getDevice()->_acc : nullptr,
|
||||
forceUnpinnedCopy)) {
|
||||
tprintf(DB_COPY,"locked_copy2DSync failed to use SDMA\n");
|
||||
retStatus = false;
|
||||
}
|
||||
#else
|
||||
crit->_av.copy2d_ext(src, dst, width, height, srcPitch, dstPitch, hcCopyDir, srcPtrInfo, dstPtrInfo,
|
||||
copyDevice ? ©Device->getDevice()->_acc : nullptr,
|
||||
forceUnpinnedCopy);
|
||||
#endif
|
||||
}
|
||||
return retStatus;
|
||||
}
|
||||
|
||||
void ihipStream_t::addSymbolPtrToTracker(hc::accelerator& acc, void* ptr, size_t sizeBytes) {
|
||||
@@ -2338,8 +2348,9 @@ void ihipStream_t::locked_copyAsync(void* dst, const void* src, size_t sizeBytes
|
||||
}
|
||||
}
|
||||
|
||||
void ihipStream_t::locked_copy2DAsync(void* dst, const void* src, size_t width, size_t height, size_t srcPitch, size_t dstPitch, unsigned kind)
|
||||
bool ihipStream_t::locked_copy2DAsync(void* dst, const void* src, size_t width, size_t height, size_t srcPitch, size_t dstPitch, unsigned kind)
|
||||
{
|
||||
bool retStatus = true;
|
||||
const ihipCtx_t* ctx = this->getCtx();
|
||||
|
||||
if ((ctx == nullptr) || (ctx->getDevice() == nullptr)) {
|
||||
@@ -2374,13 +2385,26 @@ void ihipStream_t::locked_copy2DAsync(void* dst, const void* src, size_t width,
|
||||
|
||||
try {
|
||||
if (HIP_FORCE_SYNC_COPY) {
|
||||
#if (__hcc_workweek__ >= 19062)
|
||||
if(!crit->_av.copy2d_ext(src, dst, width, height, srcPitch, dstPitch, hcCopyDir, srcPtrInfo, dstPtrInfo,
|
||||
©Device->getDevice()->_acc,
|
||||
forceUnpinnedCopy)){
|
||||
tprintf(DB_COPY,"locked_copy2DASync with HIP_FORCE_SYNC_COPY failed to use SDMA\n");
|
||||
retStatus = false;
|
||||
}
|
||||
#else
|
||||
crit->_av.copy2d_ext(src, dst, width, height, srcPitch, dstPitch, hcCopyDir, srcPtrInfo, dstPtrInfo,
|
||||
©Device->getDevice()->_acc,
|
||||
forceUnpinnedCopy);
|
||||
#endif
|
||||
|
||||
} else {
|
||||
crit->_av.copy2d_async_ext(src, dst, width, height, srcPitch, dstPitch, hcCopyDir, srcPtrInfo, dstPtrInfo,
|
||||
const auto& future = crit->_av.copy2d_async_ext(src, dst, width, height, srcPitch, dstPitch, hcCopyDir, srcPtrInfo, dstPtrInfo,
|
||||
©Device->getDevice()->_acc);
|
||||
if(!future.valid()) {
|
||||
tprintf(DB_COPY, "locked_copy2DAsync failed to use SDMA\n");
|
||||
retStatus = false;
|
||||
}
|
||||
}
|
||||
} catch (Kalmar::runtime_exception) {
|
||||
throw ihipException(hipErrorRuntimeOther);
|
||||
@@ -2395,10 +2419,20 @@ void ihipStream_t::locked_copy2DAsync(void* dst, const void* src, size_t width,
|
||||
} else {
|
||||
//Do sync 2D copy
|
||||
LockedAccessor_StreamCrit_t crit(_criticalData);
|
||||
#if (__hcc_workweek__ >= 19062)
|
||||
if(!crit->_av.copy2d_ext(src, dst, width, height, srcPitch, dstPitch, hcCopyDir, srcPtrInfo, dstPtrInfo,
|
||||
copyDevice ? ©Device->getDevice()->_acc : nullptr,
|
||||
forceUnpinnedCopy)){
|
||||
tprintf(DB_COPY, "locked_copy2DAsync Sync copy failed to use SDMA\n");
|
||||
retStatus = false;
|
||||
}
|
||||
#else
|
||||
crit->_av.copy2d_ext(src, dst, width, height, srcPitch, dstPitch, hcCopyDir, srcPtrInfo, dstPtrInfo,
|
||||
copyDevice ? ©Device->getDevice()->_acc : nullptr,
|
||||
forceUnpinnedCopy);
|
||||
#endif
|
||||
}
|
||||
return retStatus;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
@@ -2485,4 +2519,4 @@ namespace hip_impl {
|
||||
std::terminate();
|
||||
#endif
|
||||
}
|
||||
} // Namespace hip_impl.
|
||||
} // Namespace hip_impl.
|
||||
|
||||
Reference in New Issue
Block a user