From d941f19399e9b4f040aec5d41123e7073913cbc3 Mon Sep 17 00:00:00 2001 From: "Wen-Heng (Jack) Chung" Date: Thu, 21 Mar 2019 17:18:16 +0000 Subject: [PATCH] HACK for SWDEV-173477 For code objects with global symbols of length 0, ROCR runtime would ignore them even though they exist in the symbol table. Therefore the result from read_agent_globals() can't be trusted entirely. As a workaround to tame applications which depend on the existence of global symbols with length 0, always return hipSuccess here. This behavior shall be reverted once ROCR runtime has been fixed to address SWDEV-173477 --- include/hip/hcc_detail/hip_runtime_api.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/include/hip/hcc_detail/hip_runtime_api.h b/include/hip/hcc_detail/hip_runtime_api.h index f10c7ef575..3c6792e884 100644 --- a/include/hip/hcc_detail/hip_runtime_api.h +++ b/include/hip/hcc_detail/hip_runtime_api.h @@ -2621,7 +2621,20 @@ hipError_t read_agent_global_from_module(hipDeviceptr_t* dptr, size_t* bytes, std::tie(*dptr, *bytes) = read_global_description(it0->second.cbegin(), it0->second.cend(), name); - return *dptr ? hipSuccess : hipErrorNotFound; + // HACK for SWDEV-173477 + // + // For code objects with global symbols of length 0, ROCR runtime would + // ignore them even though they exist in the symbol table. Therefore the + // result from read_agent_globals() can't be trusted entirely. + // + // As a workaround to tame applications which depend on the existence of + // global symbols with length 0, always return hipSuccess here. + // + // This behavior shall be reverted once ROCR runtime has been fixed to + // address SWDEV-173477 + + //return *dptr ? hipSuccess : hipErrorNotFound; + return hipSuccess; } inline