SWDEV-440866 - [hip-roclr] Adds support to batch memory operations APIs
Change-Id: I449ffca44bbb04d13348d112e896d603c70fd485
이 커밋은 다음에 포함됨:
1 부모
c47f9dda58
커밋
bd5d8e9baf
18 파일이 변경됨
+217
-16
검색과 일치하는 파일 없음
@@ -299,7 +299,7 @@ if(WIN32 OR NOT BUILD_SHARED_LIBS)
|
||||
# rocprofiler-register is not support on Windows
|
||||
set(HIP_ENABLE_ROCPROFILER_REGISTER OFF)
|
||||
else()
|
||||
option(HIP_ENABLE_ROCPROFILER_REGISTER "Enable rocprofiler-register support" ON)
|
||||
option(HIP_ENABLE_ROCPROFILER_REGISTER "Enable rocprofiler-register support" ON)
|
||||
endif()
|
||||
|
||||
if(HIP_ENABLE_ROCPROFILER_REGISTER)
|
||||
|
||||
@@ -480,3 +480,4 @@ hipGraphExecNodeSetParams
|
||||
hipDrvGraphMemcpyNodeSetParams
|
||||
hipDrvGraphMemcpyNodeGetParams
|
||||
hipExtHostAlloc
|
||||
hipStreamBatchMemOp
|
||||
@@ -602,6 +602,8 @@ hipError_t hipStreamWaitValue64(hipStream_t stream, void* ptr, uint64_t value, u
|
||||
uint64_t mask);
|
||||
hipError_t hipStreamWriteValue32(hipStream_t stream, void* ptr, uint32_t value, unsigned int flags);
|
||||
hipError_t hipStreamWriteValue64(hipStream_t stream, void* ptr, uint64_t value, unsigned int flags);
|
||||
hipError_t hipStreamBatchMemOp(hipStream_t stream, unsigned int count, hipStreamBatchMemOpParams* paramArray,
|
||||
unsigned int flags);
|
||||
hipError_t hipTexObjectCreate(hipTextureObject_t* pTexObject, const HIP_RESOURCE_DESC* pResDesc,
|
||||
const HIP_TEXTURE_DESC* pTexDesc,
|
||||
const HIP_RESOURCE_VIEW_DESC* pResViewDesc);
|
||||
@@ -1197,6 +1199,7 @@ void UpdateDispatchTable(HipDispatchTable* ptrDispatchTable) {
|
||||
ptrDispatchTable->hipStreamWaitValue64_fn = hip::hipStreamWaitValue64;
|
||||
ptrDispatchTable->hipStreamWriteValue32_fn = hip::hipStreamWriteValue32;
|
||||
ptrDispatchTable->hipStreamWriteValue64_fn = hip::hipStreamWriteValue64;
|
||||
ptrDispatchTable->hipStreamBatchMemOp_fn = hip::hipStreamBatchMemOp;
|
||||
ptrDispatchTable->hipTexObjectCreate_fn = hip::hipTexObjectCreate;
|
||||
ptrDispatchTable->hipTexObjectDestroy_fn = hip::hipTexObjectDestroy;
|
||||
ptrDispatchTable->hipTexObjectGetResourceDesc_fn = hip::hipTexObjectGetResourceDesc;
|
||||
@@ -1887,6 +1890,9 @@ HIP_ENFORCE_ABI(HipDispatchTable, hipDrvGraphMemcpyNodeSetParams_fn, 460)
|
||||
HIP_ENFORCE_ABI(HipDispatchTable, hipExtHostAlloc_fn, 461)
|
||||
// HIP_RUNTIME_API_TABLE_STEP_VERSION == 6
|
||||
HIP_ENFORCE_ABI(HipDispatchTable, hipDeviceGetTexture1DLinearMaxWidth_fn, 462)
|
||||
// HIP_RUNTIME_API_TABLE_STEP_VERSION == 7
|
||||
HIP_ENFORCE_ABI(HipDispatchTable, hipStreamBatchMemOp_fn, 463);
|
||||
|
||||
|
||||
// if HIP_ENFORCE_ABI entries are added for each new function pointer in the table, the number below
|
||||
// will be +1 of the number in the last HIP_ENFORCE_ABI line. E.g.:
|
||||
@@ -1894,9 +1900,9 @@ HIP_ENFORCE_ABI(HipDispatchTable, hipDeviceGetTexture1DLinearMaxWidth_fn, 462)
|
||||
// HIP_ENFORCE_ABI(<table>, <functor>, 8)
|
||||
//
|
||||
// HIP_ENFORCE_ABI_VERSIONING(<table>, 9) <- 8 + 1 = 9
|
||||
HIP_ENFORCE_ABI_VERSIONING(HipDispatchTable, 463)
|
||||
HIP_ENFORCE_ABI_VERSIONING(HipDispatchTable, 464)
|
||||
|
||||
static_assert(HIP_RUNTIME_API_TABLE_MAJOR_VERSION == 0 && HIP_RUNTIME_API_TABLE_STEP_VERSION == 6,
|
||||
static_assert(HIP_RUNTIME_API_TABLE_MAJOR_VERSION == 0 && HIP_RUNTIME_API_TABLE_STEP_VERSION == 7,
|
||||
"If you get this error, add new HIP_ENFORCE_ABI(...) code for the new function "
|
||||
"pointers and then update this check so it is true");
|
||||
#endif
|
||||
@@ -583,6 +583,7 @@ local:
|
||||
hip_6.3 {
|
||||
global:
|
||||
hipExtHostAlloc;
|
||||
hipStreamBatchMemOp;
|
||||
local:
|
||||
*;
|
||||
} hip_6.2;
|
||||
@@ -23,8 +23,36 @@
|
||||
#include "platform/command_utils.hpp"
|
||||
|
||||
namespace hip {
|
||||
hipError_t ihipBatchMemOperation(hipStream_t stream, cl_command_type cmdType, unsigned int count,
|
||||
hipStreamBatchMemOpParams* paramArray, unsigned int flags) {
|
||||
if (paramArray == nullptr || flags != 0 || count > 256) {
|
||||
return hipErrorInvalidValue;
|
||||
}
|
||||
|
||||
if (!hip::isValid(stream)) {
|
||||
return hipErrorContextIsDestroyed;
|
||||
}
|
||||
|
||||
hip::Stream* hip_stream = hip::getStream(stream);
|
||||
amd::Command::EventWaitList waitList;
|
||||
|
||||
amd::BatchMemoryOperationCommand* command =
|
||||
new amd::BatchMemoryOperationCommand(*hip_stream, cmdType, count,
|
||||
flags, waitList, paramArray,
|
||||
sizeof(hipStreamBatchMemOpParams));
|
||||
|
||||
if (command == nullptr) {
|
||||
return hipErrorOutOfMemory;
|
||||
}
|
||||
command->enqueue();
|
||||
command->release();
|
||||
HIP_RETURN(hipSuccess);
|
||||
}
|
||||
|
||||
|
||||
hipError_t ihipStreamOperation(hipStream_t stream, cl_command_type cmdType, void* ptr,
|
||||
uint64_t value, uint64_t mask, unsigned int flags, size_t sizeBytes) {
|
||||
uint64_t value, uint64_t mask, unsigned int flags,
|
||||
size_t sizeBytes) {
|
||||
size_t offset = 0;
|
||||
unsigned int outFlags = 0;
|
||||
|
||||
@@ -136,4 +164,15 @@ hipError_t hipStreamWriteValue64(hipStream_t stream, void* ptr, uint64_t value,
|
||||
0, // flags un-used for now set it to 0
|
||||
sizeof(uint64_t)));
|
||||
}
|
||||
|
||||
hipError_t hipStreamBatchMemOp(hipStream_t stream, unsigned int count,
|
||||
hipStreamBatchMemOpParams* paramArray, unsigned int flags) {
|
||||
HIP_INIT_API(hipStreamBatchMemOp, count, paramArray, flags);
|
||||
HIP_RETURN_DURATION(ihipBatchMemOperation(
|
||||
stream,
|
||||
ROCCLR_COMMAND_BATCH_STREAM,
|
||||
count,
|
||||
paramArray,
|
||||
flags));
|
||||
}
|
||||
} // namespace hip
|
||||
@@ -1413,6 +1413,10 @@ hipError_t hipStreamWriteValue64(hipStream_t stream, void* ptr, uint64_t value,
|
||||
unsigned int flags) {
|
||||
return hip::GetHipDispatchTable()->hipStreamWriteValue64_fn(stream, ptr, value, flags);
|
||||
}
|
||||
hipError_t hipStreamBatchMemOp(hipStream_t stream, unsigned int count,
|
||||
hipStreamBatchMemOpParams* paramArray, unsigned int flags) {
|
||||
return hip::GetHipDispatchTable()->hipStreamBatchMemOp_fn(stream, count, paramArray, flags);
|
||||
}
|
||||
hipError_t hipTexObjectCreate(hipTextureObject_t* pTexObject, const HIP_RESOURCE_DESC* pResDesc,
|
||||
const HIP_TEXTURE_DESC* pTexDesc,
|
||||
const HIP_RESOURCE_VIEW_DESC* pResViewDesc) {
|
||||
|
||||
새 이슈에서 참조
사용자 차단