From 32413bdc80ce01402ec445e5c023108ab5c2d98b Mon Sep 17 00:00:00 2001 From: foreman Date: Wed, 25 Jan 2017 21:21:04 -0500 Subject: [PATCH] P4 to Git Change 1366280 by kzhuravl@kzhuravl-kaveri-cl-on-lc on 2017/01/25 21:14:50 SWDEV-94644 - Switch back to bare numbers in pal when processing note entries. In order to use constants and enums from the llvm's header, we need to clean up similar loader's header (they conflict). Ideally we should move torwards not having headers with similar definitions. Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#32 edit --- rocclr/runtime/device/pal/palprogram.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/rocclr/runtime/device/pal/palprogram.cpp b/rocclr/runtime/device/pal/palprogram.cpp index c5b5ac9a1a..871d9cc149 100644 --- a/rocclr/runtime/device/pal/palprogram.cpp +++ b/rocclr/runtime/device/pal/palprogram.cpp @@ -20,7 +20,6 @@ #include "hsa_ext_image.h" #include "amd_hsa_loader.hpp" #if defined(WITH_LIGHTNING_COMPILER) -#include "AMDGPUPTNote.h" #include "AMDGPURuntimeMetadata.h" #include "driver/AmdCompiler.h" #include "libraries.amdgcn.inc" @@ -1604,14 +1603,17 @@ LightningProgram::setKernels( address name = (address) ¬e[1]; address desc = name + amd::alignUp(note->n_namesz, sizeof(int)); - if (note->n_type == AMDGPU::PT_NOTE::NT_AMDGPU_HSA_RUNTIME_METADATA_V_1) { + //! @todo: Use constants and enums defined in AMDGPUPTNote.h. + //! In order to switch to using constants and enums defined in + //! AMDGPUPTNote.h, we need to clean up internal header files. + if (note->n_type == 7 /*AMDGPU::PT_NOTE::NT_AMDGPU_HSA_RUNTIME_METADATA_V_1*/) { buildLog_ += "Error: object code with metadata v1 is not " \ "supported\n"; return false; } - else if (note->n_type == AMDGPU::PT_NOTE::NT_AMDGPU_HSA_RUNTIME_METADATA - && note->n_namesz == sizeof AMDGPU::PT_NOTE::NoteName - && !memcmp(name, AMDGPU::PT_NOTE::NoteName, note->n_namesz)) { + else if (note->n_type == 8 /*AMDGPU::PT_NOTE::NT_AMDGPU_HSA_RUNTIME_METADATA*/ + && note->n_namesz == sizeof "AMD" + && !memcmp(name, "AMD", note->n_namesz)) { std::string metadataStr((const char *) desc, (size_t) note->n_descsz); metadata_ = new AMDGPU::RuntimeMD::Program::Metadata(metadataStr); // We've found and loaded the runtime metadata, exit the