Skip to content

Commit

Permalink
Add CTest module to subdirectories' CMakeLists files
Browse files Browse the repository at this point in the history
  • Loading branch information
sohaibnd committed Jan 31, 2025
1 parent d45d2db commit afd1654
Show file tree
Hide file tree
Showing 16 changed files with 25 additions and 3 deletions.
1 change: 1 addition & 0 deletions Applications/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(Applications LANGUAGES CXX)
include(CTest)

file(RELATIVE_PATH folder_bin ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${folder_bin})
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

cmake_minimum_required(VERSION 3.21.3 FATAL_ERROR)
project(ROCm-SDK-Examples LANGUAGES CXX VERSION 6.3.0)
enable_testing()
include(CTest)

add_subdirectory(Applications)
add_subdirectory(HIP-Basic)
Expand Down
5 changes: 3 additions & 2 deletions HIP-Basic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(HIP-Basic LANGUAGES CXX)
include(CTest)

# ROCm installation path
if(WIN32)
Expand Down Expand Up @@ -67,7 +68,7 @@ if(NOT "${GPU_RUNTIME}" STREQUAL "CUDA")
)

if(LLVM_DIS_COMMAND AND OFFLOAD_BUNDLER_COMMAND AND LLVM_MC_COMMAND)
add_subdirectory(llvm_ir_to_executable)
#add_subdirectory(llvm_ir_to_executable)
else()
message(
"'llvm-dis', 'llvm-mc', or 'clang-offload-bundler' not found, not building assembly example."
Expand All @@ -80,7 +81,7 @@ if(NOT "${GPU_RUNTIME}" STREQUAL "CUDA")
endif()

if(OFFLOAD_BUNDLER_COMMAND AND LLVM_MC_COMMAND)
add_subdirectory(assembly_to_executable)
#add_subdirectory(assembly_to_executable)
else()
message(
"'llvm-mc' or 'clang-offload-bundler' not found, not building LLVM IR example."
Expand Down
1 change: 1 addition & 0 deletions Libraries/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(Libraries LANGUAGES CXX)
include(CTest)

file(RELATIVE_PATH folder_bin ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${folder_bin})
Expand Down
1 change: 1 addition & 0 deletions Libraries/hipBLAS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(hipBLAS_examples LANGUAGES CXX)
include(CTest)

file(RELATIVE_PATH folder_bin ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${folder_bin})
Expand Down
1 change: 1 addition & 0 deletions Libraries/hipCUB/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(hipCUB_examples LANGUAGES CXX)
include(CTest)

file(RELATIVE_PATH folder_bin ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${folder_bin})
Expand Down
1 change: 1 addition & 0 deletions Libraries/hipFFT/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(hipFFT_examples LANGUAGES CXX)
include(CTest)

file(RELATIVE_PATH folder_bin ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${folder_bin})
Expand Down
1 change: 1 addition & 0 deletions Libraries/hipSOLVER/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(hipSOLVER_examples LANGUAGES CXX)
include(CTest)

file(RELATIVE_PATH folder_bin ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${folder_bin})
Expand Down
1 change: 1 addition & 0 deletions Libraries/rocBLAS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(rocBLAS_examples LANGUAGES CXX)
include(CTest)

file(RELATIVE_PATH folder_bin ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${folder_bin})
Expand Down
8 changes: 8 additions & 0 deletions Libraries/rocFFT/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(rocFFT_examples LANGUAGES CXX)
include(CTest)

file(RELATIVE_PATH folder_bin ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${folder_bin})
Expand Down Expand Up @@ -55,3 +56,10 @@ endif()

add_subdirectory(callback)
add_subdirectory(multi_gpu)

add_custom_target(rocFFT_examples DEPENDS rocfft_callback rocfft_multi_gpu)
#if(NOT "${DEMO_ENABLE_TARGETS}" STREQUAL "")
# foreach(target IN LISTS DEMO_ENABLE_TARGETS)
# add_dependencies(enabled_targets ${target})
# endforeach()
#endif()
1 change: 1 addition & 0 deletions Libraries/rocPRIM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(rocPRIM_examples LANGUAGES CXX)
include(CTest)

file(RELATIVE_PATH folder_bin ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${folder_bin})
Expand Down
1 change: 1 addition & 0 deletions Libraries/rocRAND/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(rocRAND_examples LANGUAGES CXX)
include(CTest)

file(RELATIVE_PATH folder_bin ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${folder_bin})
Expand Down
1 change: 1 addition & 0 deletions Libraries/rocSOLVER/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(rocSOLVER_examples LANGUAGES CXX)
include(CTest)

file(RELATIVE_PATH folder_bin ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${folder_bin})
Expand Down
1 change: 1 addition & 0 deletions Libraries/rocSPARSE/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(rocSPARSE_examples LANGUAGES CXX)
include(CTest)

file(RELATIVE_PATH folder_bin ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${folder_bin})
Expand Down
1 change: 1 addition & 0 deletions Libraries/rocThrust/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(rocThrust_examples LANGUAGES CXX)
include(CTest)

file(RELATIVE_PATH folder_bin ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${folder_bin})
Expand Down
1 change: 1 addition & 0 deletions Tutorials/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
project(Tutorials LANGUAGES CXX)
include(CTest)

file(RELATIVE_PATH folder_bin ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${folder_bin})
Expand Down

0 comments on commit afd1654

Please sign in to comment.