From f8386e274a11a26230d419c28d349014d1a26f34 Mon Sep 17 00:00:00 2001 From: Rahul Garg Date: Tue, 7 May 2019 05:09:02 +0530 Subject: [PATCH] Maintain HIP_VISIBLE_DEVICES for kernel launch [ROCm/hip commit: 620a07102d4e9dc74d4176aa71bd615bb30752e9] --- projects/hip/src/hip_hcc.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/projects/hip/src/hip_hcc.cpp b/projects/hip/src/hip_hcc.cpp index ac285e6a83..6f2e41cd49 100644 --- a/projects/hip/src/hip_hcc.cpp +++ b/projects/hip/src/hip_hcc.cpp @@ -2504,14 +2504,16 @@ hipError_t hipHccGetAcceleratorView(hipStream_t stream, hc::accelerator_view** a namespace hip_impl { std::vector all_hsa_agents() { std::vector r{}; - for (auto&& acc : hc::accelerator::get_all()) { + std::vector visible_accelerators; + for (int i=0; i < g_deviceCnt; i++) + visible_accelerators.push_back(g_deviceArray[i]->_acc); + for (auto&& acc : visible_accelerators) { const auto agent = acc.get_hsa_agent(); if (!agent || !acc.is_hsa_accelerator()) continue; r.emplace_back(*static_cast(agent)); } - return r; }