File tree Expand file tree Collapse file tree 5 files changed +14
-52
lines changed
c_cpp_api/simple_distributions_cpp Expand file tree Collapse file tree 5 files changed +14
-52
lines changed Original file line number Diff line number Diff line change @@ -52,14 +52,6 @@ list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}")
5252
5353find_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.
6456if (ROCM_EXAMPLES_HIP_PLATFORM STREQUAL "nvidia" )
6557 find_package (CUDAToolkit REQUIRED)
Original file line number Diff line number Diff line change @@ -52,14 +52,6 @@ list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}")
5252
5353find_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.
6456if (ROCM_EXAMPLES_HIP_PLATFORM STREQUAL "nvidia" )
6557 find_package (CUDAToolkit REQUIRED)
Original file line number Diff line number Diff line change @@ -52,14 +52,6 @@ list(APPEND CMAKE_PREFIX_PATH "${ROCM_ROOT}")
5252
5353find_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.
6456if (ROCM_EXAMPLES_HIP_PLATFORM STREQUAL "nvidia" )
6557 find_package (CUDAToolkit REQUIRED)
Original file line number Diff line number Diff line change @@ -25,21 +25,14 @@ set(example_name rocrand_pseudorandom_generations)
2525cmake_minimum_required (VERSION 3.21 FATAL_ERROR)
2626project (${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
4437if (WIN32 )
4538 set (ROCM_ROOT
Original file line number Diff line number Diff line change @@ -25,21 +25,14 @@ set(example_name rocrand_quasirandom_generations)
2525cmake_minimum_required (VERSION 3.21 FATAL_ERROR)
2626project (${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
4437if (WIN32 )
4538 set (ROCM_ROOT
You can’t perform that action at this time.
0 commit comments