Correct doorbell_queue_map allocation.

doorbell_queue_map should always be allocated or we will need to
add branches around all accesses.

Change-Id: I994c0eaf4be62c1a4a37bd06894272dba1fc1da6


[ROCm/ROCR-Runtime commit: f9d3796db8]
This commit is contained in:
Sean Keely
2019-09-04 19:46:41 -05:00
förälder c28aadf5a8
incheckning 9c6f904413
@@ -1149,19 +1149,6 @@ void GpuAgent::SyncClocks() {
}
void GpuAgent::BindTrapHandler() {
if (isa_->GetMajorVersion() == 7) {
// No trap handler support on Gfx7, soft error.
return;
}
// Disable trap handler on Carrizo until KFD is fixed.
if (profile_ == HSA_PROFILE_FULL) {
return;
}
// Assemble the trap handler source code.
AssembleShader("TrapHandler", AssembleTarget::ISA, trap_code_buf_, trap_code_buf_size_);
// Make an empty map from doorbell index to queue.
// The trap handler uses this to retrieve a wave's amd_queue_t*.
auto doorbell_queue_map_size = MAX_NUM_DOORBELLS * sizeof(amd_queue_t*);
@@ -1172,6 +1159,19 @@ void GpuAgent::BindTrapHandler() {
memset(doorbell_queue_map_, 0, doorbell_queue_map_size);
if (isa_->GetMajorVersion() == 7) {
// No trap handler support on Gfx7, soft error.
return;
}
// Disable trap handler on APUs until KFD is fixed.
if (profile_ == HSA_PROFILE_FULL) {
return;
}
// Assemble the trap handler source code.
AssembleShader("TrapHandler", AssembleTarget::ISA, trap_code_buf_, trap_code_buf_size_);
// Bind the trap handler to this node.
HSAKMT_STATUS err = hsaKmtSetTrapHandler(node_id(), trap_code_buf_, trap_code_buf_size_,
doorbell_queue_map_, doorbell_queue_map_size);