From 1eb3c947c3c327892d04c96287ef5f532314c6af Mon Sep 17 00:00:00 2001 From: Jonathan Bentz Date: Wed, 5 Feb 2025 19:57:07 -0600 Subject: [PATCH] changing to CMAKE_CURRENT_BINARY_DIR for the copy of input files --- Samples/7_libNVVM/cuda-c-linking/CMakeLists.txt | 2 +- Samples/7_libNVVM/cuda-shared-memory/CMakeLists.txt | 11 +++++++---- Samples/7_libNVVM/device-side-launch/CMakeLists.txt | 4 ++-- Samples/7_libNVVM/ptxgen/CMakeLists.txt | 3 ++- Samples/7_libNVVM/simple/CMakeLists.txt | 4 ++-- Samples/7_libNVVM/syscalls/CMakeLists.txt | 11 +++++++---- Samples/7_libNVVM/uvmlite/CMakeLists.txt | 4 ++-- 7 files changed, 23 insertions(+), 16 deletions(-) diff --git a/Samples/7_libNVVM/cuda-c-linking/CMakeLists.txt b/Samples/7_libNVVM/cuda-c-linking/CMakeLists.txt index 218b6f44..6e4fc351 100644 --- a/Samples/7_libNVVM/cuda-c-linking/CMakeLists.txt +++ b/Samples/7_libNVVM/cuda-c-linking/CMakeLists.txt @@ -38,7 +38,7 @@ add_custom_target(clobber) add_custom_target(testrun) add_test(NAME cuda-c-linking COMMAND cuda-c-linking - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}") + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") target_link_libraries(cuda-c-linking ${NVVM_LIB} ${CUDA_LIB}) # See https://llvm.org/docs/CMake.html#developing-llvm-passes-out-of-source diff --git a/Samples/7_libNVVM/cuda-shared-memory/CMakeLists.txt b/Samples/7_libNVVM/cuda-shared-memory/CMakeLists.txt index 0a018dc8..1a1bbeae 100644 --- a/Samples/7_libNVVM/cuda-shared-memory/CMakeLists.txt +++ b/Samples/7_libNVVM/cuda-shared-memory/CMakeLists.txt @@ -28,13 +28,16 @@ add_custom_target(clobber) add_custom_target(testrun) add_test(NAME test-cuda-shared-memory-shared_memory - COMMAND "${CMAKE_BINARY_DIR}/ptxgen/ptxgen" "${CMAKE_CURRENT_SOURCE_DIR}/shared_memory.ll" - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}") + COMMAND "${CMAKE_CURRENT_BINARY_DIR}/ptxgen/ptxgen" "${CMAKE_CURRENT_SOURCE_DIR}/shared_memory.ll" + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") add_test(NAME test-cuda-shared-memory-extern_shared_memory - COMMAND "${CMAKE_BINARY_DIR}/ptxgen/ptxgen" "${CMAKE_CURRENT_SOURCE_DIR}/extern_shared_memory.ll" - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}") + COMMAND "${CMAKE_CURRENT_BINARY_DIR}/ptxgen/ptxgen" "${CMAKE_CURRENT_SOURCE_DIR}/extern_shared_memory.ll" + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") set_tests_properties(test-cuda-shared-memory-shared_memory test-cuda-shared-memory-extern_shared_memory PROPERTIES FIXTURES_REQUIRED PTXGENTEST) + +file(COPY shared_memory.ll DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") +file(COPY extern_shared_memory.ll DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/Samples/7_libNVVM/device-side-launch/CMakeLists.txt b/Samples/7_libNVVM/device-side-launch/CMakeLists.txt index bc96961f..21cd254f 100644 --- a/Samples/7_libNVVM/device-side-launch/CMakeLists.txt +++ b/Samples/7_libNVVM/device-side-launch/CMakeLists.txt @@ -33,7 +33,7 @@ add_executable(dsl dsl.c) add_custom_target(clobber) add_custom_target(testrun) add_test(NAME device-side-launch COMMAND dsl - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}") + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") target_link_libraries(dsl ${NVVM_LIB} ${CUDA_LIB}) if (WIN32) @@ -47,4 +47,4 @@ install(FILES dsl-gpu64.ll DESTINATION bin) # 'dsl' will load dsl-gpu64.ll from the current working directory. That # .ll file should be present where tests are executed (the build directory). -file(COPY dsl-gpu64.ll DESTINATION "${CMAKE_BINARY_DIR}") +file(COPY dsl-gpu64.ll DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/Samples/7_libNVVM/ptxgen/CMakeLists.txt b/Samples/7_libNVVM/ptxgen/CMakeLists.txt index 85d341f1..1cc23fac 100644 --- a/Samples/7_libNVVM/ptxgen/CMakeLists.txt +++ b/Samples/7_libNVVM/ptxgen/CMakeLists.txt @@ -29,7 +29,7 @@ add_custom_target(clobber) add_custom_target(testrun) add_test(NAME ptxgenTest COMMAND ptxgen "${CMAKE_CURRENT_SOURCE_DIR}/test.ll" - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}") + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") set_tests_properties(ptxgenTest PROPERTIES FIXTURES_SETUP PTXGENTEST) target_link_libraries(ptxgen ${NVVM_LIB}) @@ -44,3 +44,4 @@ else (WIN32) endif (WIN32) install(TARGETS ptxgen DESTINATION bin) +file(COPY test.ll DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/Samples/7_libNVVM/simple/CMakeLists.txt b/Samples/7_libNVVM/simple/CMakeLists.txt index a4053c76..f133f3c6 100644 --- a/Samples/7_libNVVM/simple/CMakeLists.txt +++ b/Samples/7_libNVVM/simple/CMakeLists.txt @@ -30,7 +30,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR YES) add_executable(simple simple.c) add_custom_target(clobber) add_custom_target(testrun) -add_test(NAME simple COMMAND simple WORKING_DIRECTORY "${CMAKE_BINARY_DIR}") +add_test(NAME simple COMMAND simple WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") target_link_libraries(simple ${NVVM_LIB} ${CUDA_LIB}) @@ -46,4 +46,4 @@ install(FILES simple-gpu64.ll DESTINATION bin) # 'simple' will load simple-gpu64.ll from the current working directory. That # .ll file should be present where tests are executed (the build directory). -file(COPY simple-gpu64.ll DESTINATION "${CMAKE_BINARY_DIR}") +file(COPY simple-gpu64.ll DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/Samples/7_libNVVM/syscalls/CMakeLists.txt b/Samples/7_libNVVM/syscalls/CMakeLists.txt index bffae373..3bf642e3 100644 --- a/Samples/7_libNVVM/syscalls/CMakeLists.txt +++ b/Samples/7_libNVVM/syscalls/CMakeLists.txt @@ -28,12 +28,15 @@ add_custom_target(clobber) add_custom_target(testrun) add_test(NAME test-syscalls-malloc-free - COMMAND "${CMAKE_BINARY_DIR}/ptxgen/ptxgen" "${CMAKE_CURRENT_SOURCE_DIR}/malloc-free.ll" - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}") + COMMAND "${CMAKE_CURRENT_BINARY_DIR}/ptxgen/ptxgen" "${CMAKE_CURRENT_SOURCE_DIR}/malloc-free.ll" + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") add_test(NAME test-syscalls-vprintf - COMMAND "${CMAKE_BINARY_DIR}/ptxgen/ptxgen" "${CMAKE_CURRENT_SOURCE_DIR}/vprintf.ll" - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}") + COMMAND "${CMAKE_CURRENT_BINARY_DIR}/ptxgen/ptxgen" "${CMAKE_CURRENT_SOURCE_DIR}/vprintf.ll" + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") set_tests_properties(test-syscalls-vprintf test-syscalls-malloc-free PROPERTIES FIXTURES_REQUIRED PTXGENTEST) + +file(COPY malloc-free.ll DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") +file(COPY vprintf.ll DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") diff --git a/Samples/7_libNVVM/uvmlite/CMakeLists.txt b/Samples/7_libNVVM/uvmlite/CMakeLists.txt index 809c42d4..76b91b7a 100644 --- a/Samples/7_libNVVM/uvmlite/CMakeLists.txt +++ b/Samples/7_libNVVM/uvmlite/CMakeLists.txt @@ -32,7 +32,7 @@ set_property(SOURCE uvmlite.c add_executable(uvmlite uvmlite.c) add_custom_target(clobber) add_custom_target(testrun) -add_test(NAME uvmlite COMMAND uvmlite WORKING_DIRECTORY "${CMAKE_BINARY_DIR}") +add_test(NAME uvmlite COMMAND uvmlite WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") target_link_libraries(uvmlite ${NVVM_LIB} ${CUDA_LIB}) if (WIN32) @@ -49,4 +49,4 @@ install(FILES uvmlite64.ll DESTINATION bin) # 'uvmlite' will load uvmlite64.ll from the current working directory. That # .ll file should be present where tests are executed (the build directory). -file(COPY uvmlite64.ll DESTINATION "${CMAKE_BINARY_DIR}") +file(COPY uvmlite64.ll DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")