From 2d65bec1eb788e2105adbe62a7c42d1966326cd5 Mon Sep 17 00:00:00 2001
From: foreman
Date: Wed, 17 May 2017 11:40:24 -0400
Subject: [PATCH] P4 to Git Change 1410629 by lmoriche@lmoriche_palamida on
2017/05/17 11:27:06
SWDEV-102733 - [OCL-LC-ROCm] Cmake build Write CMakeLists.txt to enable building with and without the DK environment
- Add FindROCR.cmake, and use find_package() to locate the ROCR
Affected files ...
... //depot/stg/opencl/drivers/opencl/CMakeLists.txt#8 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/CMakeLists.txt#5 edit
... //depot/stg/opencl/drivers/opencl/cmake/modules/FindROCR.cmake#1 add
... //depot/stg/opencl/drivers/opencl/runtime/CMakeLists.txt#3 edit
[ROCm/clr commit: 8f8d05040f0d385d6e18c7d28a467c27603e1ad9]
---
projects/clr/opencl/CMakeLists.txt | 8 ++++++++
projects/clr/opencl/api/opencl/amdocl/CMakeLists.txt | 4 +---
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/projects/clr/opencl/CMakeLists.txt b/projects/clr/opencl/CMakeLists.txt
index b54fd4298b..416cf0da8c 100644
--- a/projects/clr/opencl/CMakeLists.txt
+++ b/projects/clr/opencl/CMakeLists.txt
@@ -7,6 +7,13 @@ endif()
project(OpenCL-ROCm)
+# Add path for custom modules
+set(CMAKE_MODULE_PATH
+ ${CMAKE_MODULE_PATH}
+ "${CMAKE_CURRENT_SOURCE_DIR}/cmake"
+ "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
+ )
+
set(LLVM_INCLUDE_TESTS CACHE BOOL OFF)
set(LLVM_TARGETS_TO_BUILD "AMDGPU" CACHE STRING "")
set(LLVM_ENABLE_PROJECTS CACHE STRING "clang")
@@ -40,5 +47,6 @@ add_subdirectory(compiler/lib/loaders/elf/utils/libelf)
add_subdirectory(tools/bc2h)
+find_package(ROCR REQUIRED)
add_subdirectory(runtime)
add_subdirectory(api/opencl/amdocl)
diff --git a/projects/clr/opencl/api/opencl/amdocl/CMakeLists.txt b/projects/clr/opencl/api/opencl/amdocl/CMakeLists.txt
index 2165dcf9ab..4698bd8054 100644
--- a/projects/clr/opencl/api/opencl/amdocl/CMakeLists.txt
+++ b/projects/clr/opencl/api/opencl/amdocl/CMakeLists.txt
@@ -1,5 +1,3 @@
-find_library(HSA_LIB hsa-runtime64 HINTS /opt/rocm/lib)
-
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")
@@ -46,4 +44,4 @@ add_library(amdocl64 SHARED
$
)
-target_link_libraries(amdocl64 opencl_driver oclelf pthread dl ${HSA_LIB})
+target_link_libraries(amdocl64 opencl_driver oclelf pthread dl ${ROCR_LIBRARIES})