Skip to content

Commit ac87f89

Browse files
authored
Merge pull request #1388 from wolfpld/slomp/cuda-tests
Relocating existing CUDA tests
2 parents e627fcc + 5511e68 commit ac87f89

6 files changed

Lines changed: 63 additions & 51 deletions

File tree

examples/CUDAGraphRepro/Makefile

Lines changed: 0 additions & 49 deletions
This file was deleted.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
cmake_minimum_required(VERSION 3.18)
2+
project(CUDAGraphReproTests LANGUAGES CXX CUDA)
3+
4+
set(CMAKE_CXX_STANDARD 17)
5+
set(CMAKE_CUDA_STANDARD 17)
6+
7+
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24")
8+
set(CMAKE_CUDA_ARCHITECTURES native)
9+
endif()
10+
11+
set(TRACY_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../.."
12+
CACHE PATH "Root of the Tracy repository")
13+
set(TRACY_PUBLIC "${TRACY_PATH}/public")
14+
15+
option(TRACY_ENABLE "Enable profiling" ON)
16+
17+
find_package(CUDAToolkit REQUIRED)
18+
find_package(Threads REQUIRED)
19+
20+
# Tracy client (CXX-only, matching the Makefile's g++ step for TracyClient.cpp)
21+
add_library(TracyClient STATIC ${TRACY_PUBLIC}/TracyClient.cpp)
22+
target_include_directories(TracyClient PUBLIC ${TRACY_PUBLIC})
23+
target_link_libraries(TracyClient PUBLIC Threads::Threads ${CMAKE_DL_LIBS})
24+
if(TRACY_ENABLE)
25+
target_compile_definitions(TracyClient PUBLIC TRACY_ENABLE)
26+
endif()
27+
28+
# repro: Tracy-integrated CUDA Graph reproducer
29+
add_executable(repro repro.cu)
30+
target_link_libraries(repro PRIVATE TracyClient CUDA::cupti CUDA::cuda_driver)
31+
32+
# Standalone CUPTI probes (no Tracy dependency)
33+
add_executable(test_corr_reuse test_corr_reuse.cu)
34+
target_link_libraries(test_corr_reuse PRIVATE CUDA::cupti CUDA::cuda_driver)
35+
36+
add_executable(test_graphid_recycle test_graphid_recycle.cu)
37+
target_link_libraries(test_graphid_recycle PRIVATE CUDA::cupti CUDA::cuda_driver)
38+
39+
set(_all_targets repro test_corr_reuse test_graphid_recycle)
40+
41+
# ctest-related integration below
42+
# to run the binaries via ctest:
43+
# ctest --test-dir <cmake-build-dir> -R <binary-name> -C <build-config>
44+
45+
enable_testing()
46+
foreach(_target ${_all_targets})
47+
add_test(NAME ${_target} COMMAND ${_target})
48+
endforeach()
49+
50+
# On Windows, CUPTI's DLL must be on PATH at runtime.
51+
# Propagate the DLL directory to both the VS debugger and ctest.
52+
if(WIN32)
53+
set(_cupti_dir "$<TARGET_FILE_DIR:CUDA::cupti>")
54+
foreach(_target ${_all_targets})
55+
set_target_properties(${_target} PROPERTIES
56+
VS_DEBUGGER_ENVIRONMENT "PATH=${_cupti_dir};$ENV{PATH}")
57+
set_tests_properties(${_target} PROPERTIES
58+
ENVIRONMENT "PATH=${_cupti_dir};$ENV{PATH}")
59+
endforeach()
60+
endif()
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ drops every GPU zone.
1414
## Build and run
1515

1616
```bash
17-
make
18-
./repro
17+
cmake -S . -B ./build
18+
cmake --build ./build --parallel --config Release
19+
ctest --test-dir ./build -C Release -R repro
1920
```
2021

2122
## What to expect
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)