P4 to Git Change 1412181 by yaxunl@yaxunl_stg_win50 on 2017/05/20 20:14:34
SWDEV-121585 - [OCL-LC-ROCm] Merge GitHub pull requests - Merged https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime/pull/8 Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/CMakeLists.txt#4 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/roccompiler.cpp#33 edit
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
set(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=0 -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)
|
||||
|
||||
include_directories(${ROCR_INCLUDE_DIRS})
|
||||
|
||||
@@ -26,6 +26,12 @@
|
||||
#include <libgen.h>
|
||||
#endif // defined(ATI_OS_LINUX)
|
||||
|
||||
#define QUOTE(s) #s
|
||||
#define STRING(s) QUOTE(s)
|
||||
#ifndef AMDGCN_TRIPLE
|
||||
#define AMDGCN_TRIPLE amdgcn-amd-amdhsa-opencl
|
||||
#endif
|
||||
|
||||
#if defined(WITH_LIGHTNING_COMPILER)
|
||||
static std::string llvmBin_(amd::Os::getEnvironment("LLVM_BIN"));
|
||||
#endif // defined(WITH_LIGHTNING_COMPILER)
|
||||
@@ -158,7 +164,7 @@ bool HSAILProgram::compileImpl_LC(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 " STRING(AMDGCN_TRIPLE) " -x cl "
|
||||
<< driverOptions << " -include opencl-c.h "
|
||||
<< "\n*/\n\n"
|
||||
<< sourceCode;
|
||||
|
||||
Reference in New Issue
Block a user