From e0ec13986685852d03682508e1c92bb028c8fa34 Mon Sep 17 00:00:00 2001 From: Tony Date: Wed, 1 Jul 2020 02:37:30 +0000 Subject: [PATCH] Define URI for deprecated hsa_executable_load_code_object Change-Id: Id9b6f8895bdafa3460a27984e0f773ec153378d7 [ROCm/ROCR-Runtime commit: ac3244d4317d9147a4bc5f4dc64bfe5f7e02d90c] --- .../runtime/hsa-runtime/core/runtime/hsa.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa.cpp index 105960f2da..705613a695 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa.cpp @@ -55,6 +55,8 @@ #include "core/inc/queue.h" #include "core/inc/signal.h" #include "core/inc/cache.h" +#include "core/inc/amd_elf_image.hpp" +#include "core/inc/amd_hsa_loader.hpp" #include "core/inc/amd_loader_context.hpp" #include "core/inc/hsa_ven_amd_loader_impl.h" #include "inc/hsa_ven_amd_aqlprofile.h" @@ -2205,7 +2207,14 @@ hsa_status_t hsa_executable_load_code_object( return HSA_STATUS_ERROR_INVALID_EXECUTABLE; } - return exec->LoadCodeObject(agent, code_object, options, std::string()); + void *code_object_p = reinterpret_cast(code_object.handle); + if (!code_object_p) { + return HSA_STATUS_ERROR_INVALID_CODE_OBJECT; + } + CodeObjectReaderImpl reader; + reader.SetMemory(code_object_p, amd::elf::ElfSize(code_object_p)); + + return exec->LoadCodeObject(agent, code_object, options, reader.GetUri()); CATCH; }