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: b0396b47e1]
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
@@ -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"));
|
||||
|
||||
Reference in New Issue
Block a user