Make hsa_agent_t handles use pointer to device::Device

For roc devices create hsa_agent_t handles using a pointer to the
device::Device. This ensures each device has a different hsa_agent_t
handle. This may be necessary to ensure the loader symbol lookup will
search only symbols for the correct device.

Change-Id: Iee6dd40d68bf22a02ce8c75cbe5ac8f5a0d9e418
This commit is contained in:
Tony Tye
2021-01-10 10:33:58 +00:00
parent 583dddf6b6
commit 76c371d78a
4 changed files with 34 additions and 18 deletions
+1 -2
View File
@@ -1619,8 +1619,7 @@ bool HSAILProgram::linkImpl(amd::option::Options* options) {
}
}
// ACL_TYPE_CG stage is not performed for offline compilation
hsa_agent_t agent;
agent.handle = 1;
hsa_agent_t agent = {amd::Device::toHandle(&(device()))};
if (hsaLoad) {
executable_ = loader_->CreateExecutable(HSA_PROFILE_FULL, NULL);
if (executable_ == NULL) {