From 5975c465ad81cbb79dfba34d75ebff6c83a98d49 Mon Sep 17 00:00:00 2001 From: Sean Keely Date: Fri, 19 Oct 2018 17:07:24 -0500 Subject: [PATCH] Fully initialize GPU agents before loading tools. Required for debug agent requires copy API and trap handler to be initalized prior to loading. Existing tools do not make use of internal queue or scratch memory intercept which is what PostToolsInit allows. PostToolsInit() will be removed in a following cleanup change. Change-Id: If43377843808e3eff0defd9204910a67a852902f --- runtime/hsa-runtime/core/runtime/runtime.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/runtime/hsa-runtime/core/runtime/runtime.cpp b/runtime/hsa-runtime/core/runtime/runtime.cpp index 5b61eaef5c..d0e2c5885a 100644 --- a/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/runtime/hsa-runtime/core/runtime/runtime.cpp @@ -1218,9 +1218,7 @@ hsa_status_t Runtime::Load() { // Load extensions LoadExtensions(); - // Load tools libraries - LoadTools(); - + // Initialize per GPU scratch, blits, and trap handler for (core::Agent* agent : gpu_agents_) { hsa_status_t status = reinterpret_cast(agent)->PostToolsInit(); @@ -1230,6 +1228,9 @@ hsa_status_t Runtime::Load() { } } + // Load tools libraries + LoadTools(); + return HSA_STATUS_SUCCESS; }