From 45ec615e49c4f379fe4e4a63aa35531dcebe4c35 Mon Sep 17 00:00:00 2001 From: foreman Date: Tue, 19 Apr 2016 13:57:39 -0400 Subject: [PATCH] P4 to Git Change 1259658 by bsumner@bsumner-lin-opencl on 2016/04/19 13:49:51 SWDEV-92314 - add means for library to query for GFX8+ chip Affected files ... ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/compiler_stage.hpp#13 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/backends/common/linker.cpp#141 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/linker/include/AMDResolveLinker.h#2 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/linker/lib/AMDResolveLinker.cpp#2 edit ... //depot/stg/opencl/drivers/opencl/compiler/lib/linker/tools/opencl-link/opencl-link.cpp#4 edit ... //depot/stg/opencl/drivers/opencl/compiler/llvm/include/llvm/AMDLLVMContextHook.h#30 edit --- rocclr/compiler/lib/backends/common/compiler_stage.hpp | 1 + rocclr/compiler/lib/backends/common/linker.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/rocclr/compiler/lib/backends/common/compiler_stage.hpp b/rocclr/compiler/lib/backends/common/compiler_stage.hpp index 6884f57d00..1b69a9c7a3 100644 --- a/rocclr/compiler/lib/backends/common/compiler_stage.hpp +++ b/rocclr/compiler/lib/backends/common/compiler_stage.hpp @@ -97,6 +97,7 @@ namespace amdcl void setDenormsAreZero(bool Val) { hookup_.amdoptions.DenormsAreZero = Val; } void setUniformWorkGroupSize(bool Val) { hookup_.amdoptions.UniformWorkGroupSize = Val; } void setHaveFastFMA32(bool Val) { hookup_.amdoptions.HaveFastFMA32 = Val; } + void setISAVersion(int Val) { hookup_.amdoptions.ISAVersion = Val; } /*! Returns the llvm binary */ llvm::Module* LLVMBinary() const { return llvmbinary_; } diff --git a/rocclr/compiler/lib/backends/common/linker.cpp b/rocclr/compiler/lib/backends/common/linker.cpp index 307f6a5e4b..4d66c0061b 100644 --- a/rocclr/compiler/lib/backends/common/linker.cpp +++ b/rocclr/compiler/lib/backends/common/linker.cpp @@ -750,6 +750,12 @@ amdcl::OCLLinker::link(llvm::Module* input, std::vector &libs) || chip == "Hawaii" || chip == "Carrizo" || chip == ""); + setISAVersion((chip == "Hawaii") ? 701 : + ((chip == "Iceland" || chip == "Tonga") ? 800 : + ((chip == "Carrizo") ? 801 : + ((chip == "Fiji" || chip == "Baffin" || chip == "Ellesmere") ? 804 : + ((chip == "Stoney") ? 810 : + ((chip == "") ? 900 : 700)))))); LLVMBinary()->getContext().setAMDLLVMContextHook(&hookup_); std::string clp_errmsg;