From 6bbfea60651fd1cbb6a1369807f14f5e196f81e2 Mon Sep 17 00:00:00 2001 From: foreman Date: Tue, 8 Aug 2017 00:31:20 -0400 Subject: [PATCH] P4 to Git Change 1444296 by lmoriche@lmoriche_palamida on 2017/08/08 00:10:29 SWDEV-102733 - [OCL-LC-ROCm] Cmake build Write CMakeLists.txt to enable building with and without the DK environment - Disable LLVM object compression. Allows closed source LLVM binaries to run with the open source runtime - Define the DEBUG macro for Debug build types - Use the prepared amdgcn lib instead of the static lib when generating the .bc includes for the runtime. Affected files ... ... //depot/stg/opencl/drivers/opencl/CMakeLists.txt#14 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/CMakeLists.txt#9 edit ... //depot/stg/opencl/drivers/opencl/runtime/CMakeLists.txt#6 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/CMakeLists.txt#8 edit [ROCm/clr commit: f27162ba57f1002dc377a684924f42d87aab3386] --- projects/clr/rocclr/CMakeLists.txt | 1 + projects/clr/rocclr/runtime/CMakeLists.txt | 4 ++++ projects/clr/rocclr/runtime/device/rocm/CMakeLists.txt | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/projects/clr/rocclr/CMakeLists.txt b/projects/clr/rocclr/CMakeLists.txt index a679c4f2f3..905d9da93a 100644 --- a/projects/clr/rocclr/CMakeLists.txt +++ b/projects/clr/rocclr/CMakeLists.txt @@ -19,6 +19,7 @@ set(LLVM_BUILD_TOOLS CACHE BOOL OFF) set(LLVM_TARGETS_TO_BUILD "AMDGPU" CACHE STRING "") set(LLVM_ENABLE_PROJECTS CACHE STRING "clang") set(LLVM_BUILD_GLOBAL_ISEL CACHE BOOL OFF) +set(LLVM_ENABLE_ZLIB OFF CACHE BOOL "") set(CLANG_ENABLE_ARCMT CACHE BOOL OFF) set(CLANG_ENABLE_STATIC_ANALYZER CACHE BOOL OFF) diff --git a/projects/clr/rocclr/runtime/CMakeLists.txt b/projects/clr/rocclr/runtime/CMakeLists.txt index b1a01c1140..1fe750b66a 100644 --- a/projects/clr/rocclr/runtime/CMakeLists.txt +++ b/projects/clr/rocclr/runtime/CMakeLists.txt @@ -9,6 +9,10 @@ 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) +if(CMAKE_BUILD_TYPE MATCHES "^Debug$") + add_definitions(-DDEBUG) +endif() + include_directories(${ROCR_INCLUDE_DIRS}) include_directories(${CMAKE_SOURCE_DIR}/runtime) diff --git a/projects/clr/rocclr/runtime/device/rocm/CMakeLists.txt b/projects/clr/rocclr/runtime/device/rocm/CMakeLists.txt index 241dc1ebda..8dfbaa39c2 100644 --- a/projects/clr/rocclr/runtime/device/rocm/CMakeLists.txt +++ b/projects/clr/rocclr/runtime/device/rocm/CMakeLists.txt @@ -28,7 +28,7 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/libraries.amdgcn.inc "// Automatically ge foreach(AMDGCN_LIB_TARGET ${AMDGCN_LIB_TARGETS}) get_target_property(lib_file_name ${AMDGCN_LIB_TARGET} ARCHIVE_OUTPUT_NAME) get_target_property(lib_file_path ${AMDGCN_LIB_TARGET} ARCHIVE_OUTPUT_DIRECTORY) - set(bclib "${lib_file_path}/${lib_file_name}.lib.bc") + set(bclib "${lib_file_path}/${lib_file_name}.amdgcn.bc") set(header "${lib_file_name}.${INC_SUFFIX}") set(symbol "${lib_file_name}_amdgcn") add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${header}