SWDEV-480209 - Make internal callbacks non-blocking

Change-Id: Ic918d08f341abfd9a7c167d09f9c723cdc43157f
이 커밋은 다음에 포함됨:
Anusha GodavarthySurya 작성하고 Anusha Godavarthy Surya가 2025-01-10 02:16:11 -05:00를 커밋함
1 부모 c9dd95bf6c
커밋 683a942364
11 파일이 변경됨
+38 -34

검색과 일치하는 파일 없음

+2
파일 보기
@@ -1476,6 +1476,8 @@ hipError_t hipGraphExecDestroy(hipGraphExec_t pGraphExec) {
}
hip::GraphExec* ge = reinterpret_cast<hip::GraphExec*>(pGraphExec);
ge->release();
amd::ScopedLock lock(GraphExec::graphExecSetLock_);
GraphExec::graphExecSet_.erase(ge);
HIP_RETURN(hipSuccess);
}
+2 -12
파일 보기
@@ -732,21 +732,11 @@ hipError_t GraphExec::Run(hipStream_t graph_launch_stream) {
// we may not need to flush any caches.
CallbackCommand->setEventScope(amd::Device::kCacheStateIgnore);
amd::Event& event = CallbackCommand->event();
if (!event.setCallback(CL_COMPLETE, GraphExec::DecrementRefCount, this)) {
constexpr bool kBlocking = false;
if (!event.setCallback(CL_COMPLETE, GraphExec::DecrementRefCount, this, kBlocking)) {
return hipErrorInvalidHandle;
}
CallbackCommand->enqueue();
// Add the new barrier to stall the stream, until the callback is done
amd::Command::EventWaitList eventWaitList;
eventWaitList.push_back(CallbackCommand);
amd::Command* block_command = new amd::Marker(*launch_stream, kMarkerDisableFlush, eventWaitList);
// we may not need to flush any caches.
block_command->setEventScope(amd::Device::kCacheStateIgnore);
if (block_command == nullptr) {
return hipErrorInvalidValue;
}
block_command->enqueue();
block_command->release();
CallbackCommand->release();
return status;
}
+2 -4
파일 보기
@@ -750,12 +750,10 @@ struct GraphExec : public amd::ReferenceCountedObject, public Graph {
~GraphExec() {
for (auto stream : parallel_streams_) {
if (stream != nullptr) {
stream->finish();
hip::Stream::Destroy(stream);
constexpr bool kForceDestroy = true;
hip::Stream::Destroy(stream, kForceDestroy);
}
}
amd::ScopedLock lock(graphExecSetLock_);
graphExecSet_.erase(this);
if (DEBUG_CLR_GRAPH_PACKET_CAPTURE) {
if (kernArgManager_ != nullptr) {
kernArgManager_->release();
+1 -1
파일 보기
@@ -372,7 +372,7 @@ public:
/// Check whether any blocking stream running
static bool StreamCaptureBlocking();
static void Destroy(hip::Stream* stream);
static void Destroy(hip::Stream* stream, bool forceDestroy = false);
virtual bool terminate();
+2 -1
파일 보기
@@ -72,8 +72,9 @@ bool Stream::Create() {
}
// ================================================================================================
void Stream::Destroy(hip::Stream* stream) {
void Stream::Destroy(hip::Stream* stream, bool forceDestroy) {
stream->device_->RemoveStream(stream);
stream->SetForceDestroy(forceDestroy);
stream->release();
stream = nullptr;
}