From 4208e8e04b4133b70dfed94b65a52ca54ce3f081 Mon Sep 17 00:00:00 2001
From: foreman
Date: Wed, 5 Sep 2018 09:11:51 -0400
Subject: [PATCH] P4 to Git Change 1601829 by marsenau@marsenau-fiji on
2018/09/05 09:00:19
SWDEV-79445 - Stop using -opencl component of triple. This
hasn't been needed in a while.
Also stop redundantly defining extension macros.
Affected files ...
... //depot/stg/opencl/drivers/opencl/opencldefs#231 edit
... //depot/stg/opencl/drivers/opencl/runtime/CMakeLists.txt#10 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palcompiler.cpp#24 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/CMakeLists.txt#12 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/roccompiler.cpp#43 edit
[ROCm/clr commit: b0396b47e1a7b27b84af9b9e2f58777fff294c09]
---
projects/clr/rocclr/runtime/CMakeLists.txt | 7 -------
projects/clr/rocclr/runtime/device/pal/palcompiler.cpp | 2 +-
projects/clr/rocclr/runtime/device/rocm/CMakeLists.txt | 4 ++--
projects/clr/rocclr/runtime/device/rocm/roccompiler.cpp | 4 +---
4 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/projects/clr/rocclr/runtime/CMakeLists.txt b/projects/clr/rocclr/runtime/CMakeLists.txt
index 69b1e70a84..f35f7a3749 100644
--- a/projects/clr/rocclr/runtime/CMakeLists.txt
+++ b/projects/clr/rocclr/runtime/CMakeLists.txt
@@ -1,12 +1,5 @@
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
-option(GENERIC_IS_ZERO "Teach LLVM/Clang that generic address space IS address space 0 for AMDGPU target" OFF)
-if (GENERIC_IS_ZERO)
- add_definitions(-DAMDGCN_TRIPLE=amdgcn-amd-amdhsa-amdgizcl)
-else (GENERIC_IS_ZERO)
- add_definitions(-DAMDGCN_TRIPLE=amdgcn-amd-amdhsa-opencl)
-endif (GENERIC_IS_ZERO)
-
add_definitions(-DLINUX -D__x86_64__ -D__AMD64__ -DUNIX_OS -DqLittleEndian -DOPENCL_MAJOR=2 -DOPENCL_MINOR=1 -DWITH_AQL -DWITH_ONLINE_COMPILER -DATI_OS_LINUX -DATI_ARCH_X86 -DLITTLEENDIAN_CPU -DATI_BITS_64 -DATI_COMP_GCC -DWITH_HSA_DEVICE -DWITH_TARGET_AMDGCN -DOPENCL_EXPORTS -DCL_USE_DEPRECATED_OPENCL_1_0_APIS -DCL_USE_DEPRECATED_OPENCL_1_1_APIS -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_USE_DEPRECATED_OPENCL_2_0_APIS -DVEGA10_ONLY=false -DWITH_LIGHTNING_COMPILER)
add_definitions(-DOPENCL_C_MAJOR=2 -DOPENCL_C_MINOR=0)
diff --git a/projects/clr/rocclr/runtime/device/pal/palcompiler.cpp b/projects/clr/rocclr/runtime/device/pal/palcompiler.cpp
index 3dbcde82b3..7343e03bd3 100644
--- a/projects/clr/rocclr/runtime/device/pal/palcompiler.cpp
+++ b/projects/clr/rocclr/runtime/device/pal/palcompiler.cpp
@@ -322,7 +322,7 @@ bool LightningProgram::compileImpl(const std::string& sourceCode,
std::ofstream f(options->getDumpFileName(".cl").c_str(), std::ios::trunc);
if (f.is_open()) {
f << "/* Compiler options:\n"
- "-c -emit-llvm -target amdgcn-amd-amdhsa-opencl -x cl "
+ "-c -emit-llvm -target amdgcn-amd-amdhsa -x cl "
<< driverOptions << " -include opencl-c.h "
<< "\n*/\n\n"
<< sourceCode;
diff --git a/projects/clr/rocclr/runtime/device/rocm/CMakeLists.txt b/projects/clr/rocclr/runtime/device/rocm/CMakeLists.txt
index c05fa16674..541522d80f 100644
--- a/projects/clr/rocclr/runtime/device/rocm/CMakeLists.txt
+++ b/projects/clr/rocclr/runtime/device/rocm/CMakeLists.txt
@@ -69,7 +69,7 @@ endforeach()
# generating opencl*.inc files
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/opencl1.2-c.amdgcn.pch
- COMMAND clang -cc1 -x cl-header -triple amdgcn-amd-amdhsa-opencl -Werror -O3 -Dcl_khr_fp64 -Dcl_khr_fp16 -DNDEBUG -cl-std=CL1.2 -emit-pch -o ${CMAKE_CURRENT_BINARY_DIR}/opencl1.2-c.amdgcn.pch < ${CMAKE_SOURCE_DIR}/compiler/llvm/tools/clang/lib/Headers/opencl-c.h
+ COMMAND clang -cc1 -x cl-header -triple amdgcn-amd-amdhsa -Werror -O3 -DNDEBUG -cl-std=CL1.2 -emit-pch -o ${CMAKE_CURRENT_BINARY_DIR}/opencl1.2-c.amdgcn.pch < ${CMAKE_SOURCE_DIR}/compiler/llvm/tools/clang/lib/Headers/opencl-c.h
DEPENDS clang ${CMAKE_SOURCE_DIR}/compiler/llvm/tools/clang/lib/Headers/opencl-c.h
COMMENT "Generating opencl1.2-c.amdgcn.pch"
)
@@ -83,7 +83,7 @@ add_custom_target(opencl1.2-c.amdgcn.inc_target ALL DEPENDS ${CMAKE_CURRENT_BINA
add_dependencies(oclrocm opencl1.2-c.amdgcn.inc_target)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/opencl2.0-c.amdgcn.pch
- COMMAND clang -cc1 -x cl-header -triple amdgcn-amd-amdhsa-opencl -Werror -O3 -Dcl_khr_fp64 -Dcl_khr_fp16 -DNDEBUG -cl-std=CL2.0 -emit-pch -o ${CMAKE_CURRENT_BINARY_DIR}/opencl2.0-c.amdgcn.pch < ${CMAKE_SOURCE_DIR}/compiler/llvm/tools/clang/lib/Headers/opencl-c.h
+ COMMAND clang -cc1 -x cl-header -triple amdgcn-amd-amdhsa -Werror -O3 -DNDEBUG -cl-std=CL2.0 -emit-pch -o ${CMAKE_CURRENT_BINARY_DIR}/opencl2.0-c.amdgcn.pch < ${CMAKE_SOURCE_DIR}/compiler/llvm/tools/clang/lib/Headers/opencl-c.h
DEPENDS clang ${CMAKE_SOURCE_DIR}/compiler/llvm/tools/clang/lib/Headers/opencl-c.h
COMMENT "Generating opencl2.0-c.amdgcn.pch"
)
diff --git a/projects/clr/rocclr/runtime/device/rocm/roccompiler.cpp b/projects/clr/rocclr/runtime/device/rocm/roccompiler.cpp
index 086d972693..48f00451a2 100644
--- a/projects/clr/rocclr/runtime/device/rocm/roccompiler.cpp
+++ b/projects/clr/rocclr/runtime/device/rocm/roccompiler.cpp
@@ -25,9 +25,7 @@
#define QUOTE(s) #s
#define STRING(s) QUOTE(s)
-#ifndef AMDGCN_TRIPLE
-#define AMDGCN_TRIPLE amdgcn-amd-amdhsa-opencl
-#endif
+#define AMDGCN_TRIPLE amdgcn-amd-amdhsa
#if defined(WITH_LIGHTNING_COMPILER)
static std::string llvmBin_(amd::Os::getEnvironment("LLVM_BIN"));