Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

Commit 5570fc2

Browse files
committed
Revert "Reduce the default size of the signal pool"
This reverts commit c59ec7f. Reason for revert: a regression Change-Id: I78180ba011f45af9a4cce110b14f379aa10f7d3a
1 parent a5d9392 commit 5570fc2

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

device/rocm/rocvirtual.cpp

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -453,17 +453,8 @@ bool VirtualGPU::dispatchGenericAqlPacket(
453453

454454
// TODO: placeholder to setup the kernel to populate start and end timestamp.
455455
if (timestamp_ != nullptr) {
456-
if (current_signal_ >= signal_pool_.size()) {
457-
ProfilingSignal profilingSignal = {};
458-
if (HSA_STATUS_SUCCESS != hsa_signal_create(0, 0, nullptr, &profilingSignal.signal_)) {
459-
LogPrintfError("Failed signal allocation id = %d", current_signal_);
460-
return false;
461-
}
462-
signal_pool_.push_back(profilingSignal);
463-
assert(current_signal_ < signal_pool_.size() && "Not enough signals");
464-
}
465456
// Find signal slot
466-
ProfilingSignal* profilingSignal = &signal_pool_[current_signal_++];
457+
ProfilingSignal* profilingSignal = &signal_pool_[index & queueMask];
467458
// Make sure we save the old results in the TS structure
468459
if (profilingSignal->ts_ != nullptr) {
469460
profilingSignal->ts_->checkGpuTime();
@@ -535,8 +526,6 @@ bool VirtualGPU::dispatchGenericAqlPacket(
535526
LogPrintfError("Failed signal [0x%lx] wait", signal.handle);
536527
return false;
537528
}
538-
// Reset the pool of signals
539-
current_signal_ = 0;
540529
}
541530

542531
return true;
@@ -645,9 +634,6 @@ bool VirtualGPU::releaseGpuMemoryFence() {
645634
// Release the pool, since runtime just completed a barrier
646635
resetKernArgPool();
647636

648-
// Reset the pool of signals
649-
current_signal_ = 0;
650-
651637
return true;
652638
}
653639

@@ -771,9 +757,8 @@ bool VirtualGPU::create() {
771757
gpu_queue_ = roc_device_.acquireQueue(queue_size, cooperative_, cuMask_, priority_);
772758
if (!gpu_queue_) return false;
773759

774-
constexpr uint32_t kDefaultSignalPoolSize = 32;
775760
if (!initPool(dev().settings().kernargPoolSize_,
776-
(profiling_ || (amd::IS_HIP)) ? kDefaultSignalPoolSize : 0)) {
761+
(profiling_ || (amd::IS_HIP)) ? queue_size : 0)) {
777762
LogError("Couldn't allocate arguments/signals for the queue");
778763
return false;
779764
}
@@ -876,9 +861,6 @@ void* VirtualGPU::allocKernArg(size_t size, size_t alignment) {
876861
}
877862

878863
resetKernArgPool();
879-
880-
// Reset the pool of signals
881-
current_signal_ = 0;
882864
}
883865
} while (true);
884866

device/rocm/rocvirtual.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,6 @@ class VirtualGPU : public device::VirtualDevice {
356356
uint kernarg_pool_cur_offset_;
357357

358358
std::vector<ProfilingSignal> signal_pool_; //!< Pool of signals for profiling
359-
uint32_t current_signal_ = 0; //!< Current avaialble signal in the pool
360-
361359
friend class Timestamp;
362360

363361
// PM4 packet for gfx8 performance counter

0 commit comments

Comments
 (0)