From 74578160bda78276369333d5a2f5aa982298a6f6 Mon Sep 17 00:00:00 2001 From: Laurent Morichetti Date: Tue, 5 Feb 2019 14:43:26 -0800 Subject: [PATCH] Add code-object-v3 support for the HIP-Clang path. --- hipamd/src/hip_clang.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hipamd/src/hip_clang.cpp b/hipamd/src/hip_clang.cpp index ef8d456103..0d210e2b8c 100644 --- a/hipamd/src/hip_clang.cpp +++ b/hipamd/src/hip_clang.cpp @@ -132,8 +132,12 @@ extern "C" void __hipRegisterFunction( assert(modules && modules->size() >= g_deviceCnt); for (int deviceId = 0; deviceId < g_deviceCnt; ++deviceId) { hipFunction_t function; - if (hipSuccess == hipModuleGetFunction(&function, modules->at(deviceId), deviceName) && - function != nullptr) { + if ((hipSuccess == hipModuleGetFunction(&function, modules->at(deviceId), deviceName) || + // With code-object-v3, we need to match the kernel descriptor symbol name + (hipSuccess == hipModuleGetFunction( + &function, modules->at(deviceId), + (std::string(deviceName) + std::string(".kd")).c_str() + ))) && function != nullptr) { functions[deviceId] = function; } else {