Recognize all CPU nodes in hsa_signal_create consumer list

On multi-node systems only the first CPU node was recognized in the
signal consumer list, causing fallback to non-interrupt signals.

Change-Id: I9bd0706bafbe046be9d7f210d05fa4cf1fcd16fa


[ROCm/ROCR-Runtime commit: b44417043b]
This commit is contained in:
Jay Cornwall
2016-07-09 18:38:51 -05:00
parent a03e79c3c0
commit a1f109afe7
3 changed files with 10 additions and 14 deletions
@@ -280,8 +280,6 @@ class Runtime {
Agent* blit_agent() { return blit_agent_; }
Agent* host_agent() { return host_agent_; }
const std::vector<const MemoryRegion*>& system_regions_fine() const {
return system_regions_fine_;
}
@@ -455,9 +453,6 @@ class Runtime {
// Deallocator using ::system_region_
std::function<void(void*)> system_deallocator_;
// Pointer to a host/cpu agent object.
Agent* host_agent_;
// Pointer to DMA agent.
Agent* blit_agent_;
@@ -783,7 +783,7 @@ hsa_status_t
core::Signal* ret;
bool useshost = true;
bool uses_host = false;
if (num_consumers > 0) {
IS_BAD_PTR(consumers);
@@ -796,13 +796,16 @@ hsa_status_t
return HSA_STATUS_ERROR_INVALID_ARGUMENT;
}
useshost =
(consumer_set.find(
core::Runtime::runtime_singleton_->host_agent()->public_handle()) !=
consumer_set.end());
for (const core::Agent* cpu_agent :
core::Runtime::runtime_singleton_->cpu_agents()) {
uses_host |=
(consumer_set.find(cpu_agent->public_handle()) != consumer_set.end());
}
} else {
uses_host = true;
}
if (core::g_use_interrupt_wait && useshost) {
if (core::g_use_interrupt_wait && uses_host) {
ret = new core::InterruptSignal(initial_value);
} else {
ret = new core::DefaultSignal(initial_value);
@@ -188,7 +188,6 @@ void Runtime::RegisterAgent(Agent* agent) {
HsaClockCounters clocks;
hsaKmtGetClockCounters(0, &clocks);
sys_clock_freq_ = clocks.SystemClockFrequencyHz;
host_agent_ = agent;
}
} else if (agent->device_type() == Agent::DeviceType::kAmdGpuDevice) {
gpu_agents_.push_back(agent);
@@ -791,8 +790,7 @@ bool Runtime::VMFaultHandler(hsa_signal_value_t val, void* arg) {
}
Runtime::Runtime()
: host_agent_(NULL),
blit_agent_(NULL),
: blit_agent_(NULL),
queue_count_(0),
sys_clock_freq_(0),
vm_fault_event_(NULL),