Skip to content

Commit af239d8

Browse files
authored
Fix various low-level CMakeLists.txt (#293) (#300)
* Fix rocRAND/device_api CMakeLists.txt * Remove CMake debug messages --------- (cherry picked from commit d298b9b) Signed-off-by: zichguan-amd <zichuan.guan@amd.com>
1 parent e3498e7 commit af239d8

File tree

5 files changed

+14
-52
lines changed

5 files changed

+14
-52
lines changed

Libraries/hipRAND/c_cpp_api/simple_distributions_cpp/CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,6 @@ list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}")
5252

5353
find_package(hiprand REQUIRED)
5454

55-
message(
56-
[STATUS]
57-
"${CMAKE_SYSTEM_NAME}"
58-
"${ROCM_EXAMPLES_HIP_PLATFORM}"
59-
"${GPU_RUNTIME}"
60-
"${ROCM_EXAMPLES_GPU_LANGUAGE}"
61-
)
62-
6355
#Workaround for hipRAND, requires manual linking with backend.
6456
if(ROCM_EXAMPLES_HIP_PLATFORM STREQUAL "nvidia")
6557
find_package(CUDAToolkit REQUIRED)

Libraries/hipRAND/device_api/pseudorandom_generations/CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,6 @@ list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}")
5252

5353
find_package(hiprand REQUIRED)
5454

55-
message(
56-
[STATUS]
57-
"${CMAKE_SYSTEM_NAME}"
58-
"${ROCM_EXAMPLES_HIP_PLATFORM}"
59-
"${GPU_RUNTIME}"
60-
"${ROCM_EXAMPLES_GPU_LANGUAGE}"
61-
)
62-
6355
#Workaround for hipRAND, requires manual linking with backend.
6456
if(ROCM_EXAMPLES_HIP_PLATFORM STREQUAL "nvidia")
6557
find_package(CUDAToolkit REQUIRED)

Libraries/hipRAND/device_api/quasirandom_generations/CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,6 @@ list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}")
5252

5353
find_package(hiprand REQUIRED)
5454

55-
message(
56-
[STATUS]
57-
"${CMAKE_SYSTEM_NAME}"
58-
"${ROCM_EXAMPLES_HIP_PLATFORM}"
59-
"${GPU_RUNTIME}"
60-
"${ROCM_EXAMPLES_GPU_LANGUAGE}"
61-
)
62-
6355
#Workaround for hipRAND, requires manual linking with backend.
6456
if(ROCM_EXAMPLES_HIP_PLATFORM STREQUAL "nvidia")
6557
find_package(CUDAToolkit REQUIRED)

Libraries/rocRAND/device_api/pseudorandom_generations/CMakeLists.txt

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,14 @@ set(example_name rocrand_pseudorandom_generations)
2525
cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
2626
project(${example_name} LANGUAGES CXX)
2727

28-
set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA")
29-
set(GPU_RUNTIMES "HIP" "CUDA")
30-
set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES})
28+
include("${CMAKE_CURRENT_LIST_DIR}/../../../../Common/HipPlatform.cmake")
29+
select_gpu_language()
3130

32-
if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES)
33-
message(
34-
FATAL_ERROR
35-
"Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}"
36-
)
37-
endif()
38-
39-
enable_language(${GPU_RUNTIME})
40-
set(CMAKE_${LANG}_STANDARD 17)
41-
set(CMAKE_${LANG}_EXTENSIONS OFF)
42-
set(CMAKE_${LANG}_STANDARD_REQUIRED ON)
31+
enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE})
32+
set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD 17)
33+
set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_EXTENSIONS OFF)
34+
set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD_REQUIRED ON)
35+
select_hip_platform()
4336

4437
if(WIN32)
4538
set(ROCM_ROOT

Libraries/rocRAND/device_api/quasirandom_generations/CMakeLists.txt

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,14 @@ set(example_name rocrand_quasirandom_generations)
2525
cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
2626
project(${example_name} LANGUAGES CXX)
2727

28-
set(GPU_RUNTIME "HIP" CACHE STRING "Switches between HIP and CUDA")
29-
set(GPU_RUNTIMES "HIP" "CUDA")
30-
set_property(CACHE GPU_RUNTIME PROPERTY STRINGS ${GPU_RUNTIMES})
28+
include("${CMAKE_CURRENT_LIST_DIR}/../../../../Common/HipPlatform.cmake")
29+
select_gpu_language()
3130

32-
if(NOT "${GPU_RUNTIME}" IN_LIST GPU_RUNTIMES)
33-
message(
34-
FATAL_ERROR
35-
"Only the following values are accepted for GPU_RUNTIME: ${GPU_RUNTIMES}"
36-
)
37-
endif()
38-
39-
enable_language(${GPU_RUNTIME})
40-
set(CMAKE_${LANG}_STANDARD 17)
41-
set(CMAKE_${LANG}_EXTENSIONS OFF)
42-
set(CMAKE_${LANG}_STANDARD_REQUIRED ON)
31+
enable_language(${ROCM_EXAMPLES_GPU_LANGUAGE})
32+
set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD 17)
33+
set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_EXTENSIONS OFF)
34+
set(CMAKE_${ROCM_EXAMPLES_GPU_LANGUAGE}_STANDARD_REQUIRED ON)
35+
select_hip_platform()
4336

4437
if(WIN32)
4538
set(ROCM_ROOT

0 commit comments

Comments
 (0)