From 0d55a0a39778455ae630d30e9e2891a66653a67e Mon Sep 17 00:00:00 2001 From: foreman Date: Fri, 26 May 2017 13:12:30 -0400 Subject: [PATCH] P4 to Git Change 1414821 by lmoriche@lmoriche_palamida on 2017/05/26 13:04:04 SWDEV-102733 - [OCL-LC-ROCm] Cmake build Write CMakeLists.txt to enable building with and without the DK environment - Update from git. Affected files ... ... //depot/stg/opencl/drivers/opencl/.gitignore#1 add ... //depot/stg/opencl/drivers/opencl/CMakeLists.txt#10 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/CMakeLists.txt#6 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/CMakeLists.txt#5 edit ... //depot/stg/opencl/drivers/opencl/tools/clinfo/CMakeLists.txt#1 add [ROCm/clr commit: 595192b942c31fc6c567158a64fe964e0c9f9f02] --- projects/clr/opencl/.gitignore | 1 + projects/clr/opencl/CMakeLists.txt | 11 ++++++++++- projects/clr/opencl/api/opencl/amdocl/CMakeLists.txt | 2 ++ projects/clr/opencl/tools/clinfo/CMakeLists.txt | 11 +++++++++++ 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 projects/clr/opencl/.gitignore create mode 100644 projects/clr/opencl/tools/clinfo/CMakeLists.txt diff --git a/projects/clr/opencl/.gitignore b/projects/clr/opencl/.gitignore new file mode 100644 index 0000000000..567609b123 --- /dev/null +++ b/projects/clr/opencl/.gitignore @@ -0,0 +1 @@ +build/ diff --git a/projects/clr/opencl/CMakeLists.txt b/projects/clr/opencl/CMakeLists.txt index 0ce1bdb798..da53d0ac14 100644 --- a/projects/clr/opencl/CMakeLists.txt +++ b/projects/clr/opencl/CMakeLists.txt @@ -15,6 +15,7 @@ set(CMAKE_MODULE_PATH ) set(LLVM_INCLUDE_TESTS CACHE BOOL OFF) +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) @@ -39,9 +40,9 @@ include_directories(${CMAKE_BINARY_DIR}/compiler/llvm/lib/Target/AMDGPU) add_subdirectory(compiler/driver) -set(AMDGPU_TARGET_TRIPLE "amdgcn-amd-amdhsa-opencl") set(BUILD_HC_LIB CACHE BOOL OFF) set(ROCM_DEVICELIB_INCLUDE_TESTS CACHE BOOL OFF) +set(AMDGCN_TARGETS_LIB_LIST "AMDGCN_LIB_TARGETS") add_subdirectory(library/amdgcn) add_subdirectory(compiler/lib/loaders/elf/utils/libelf) @@ -50,4 +51,12 @@ add_subdirectory(tools/bc2h) find_package(ROCR REQUIRED) add_subdirectory(runtime) + +#set(OPENCL_INCLUDE_DIRS +# ${CMAKE_SOURCE_DIR}/api/opencl/khronos/headers +# ${CMAKE_SOURCE_DIR}/api/opencl/khronos/headers/opencl2.0) + add_subdirectory(api/opencl/amdocl) +#add_subdirectory(api/opencl/khronos/icd) + +#add_subdirectory(tools/clinfo) diff --git a/projects/clr/opencl/api/opencl/amdocl/CMakeLists.txt b/projects/clr/opencl/api/opencl/amdocl/CMakeLists.txt index 4698bd8054..2f72a2f48a 100644 --- a/projects/clr/opencl/api/opencl/amdocl/CMakeLists.txt +++ b/projects/clr/opencl/api/opencl/amdocl/CMakeLists.txt @@ -1,6 +1,8 @@ set(CMAKE_CXX_FLAGS "-std=c++11") set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-Bsymbolic -Wl,--unresolved-symbols=report-all -Wl,--version-script=${CMAKE_SOURCE_DIR}/api/opencl/amdocl/amdocl.map") +set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) + 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(${CMAKE_SOURCE_DIR}/runtime) diff --git a/projects/clr/opencl/tools/clinfo/CMakeLists.txt b/projects/clr/opencl/tools/clinfo/CMakeLists.txt new file mode 100644 index 0000000000..badb6594a4 --- /dev/null +++ b/projects/clr/opencl/tools/clinfo/CMakeLists.txt @@ -0,0 +1,11 @@ +set(CMAKE_CXX_FLAGS "-std=c++11") + +set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + +include_directories(${OPENCL_INCLUDE_DIRS}) + +add_definitions(-DHAVE_CL2_HPP) + +add_executable(clinfo clinfo.cpp) + +target_link_libraries(clinfo OpenCL)