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 bbdd0ae8..bc96a297 100644 --- a/Samples/7_libNVVM/device-side-launch/CMakeLists.txt +++ b/Samples/7_libNVVM/device-side-launch/CMakeLists.txt @@ -32,7 +32,7 @@ set_property(SOURCE dsl.c add_executable(dsl dsl.c) 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) @@ -46,4 +46,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 3e7c9f82..591b43e1 100644 --- a/Samples/7_libNVVM/ptxgen/CMakeLists.txt +++ b/Samples/7_libNVVM/ptxgen/CMakeLists.txt @@ -28,7 +28,7 @@ add_executable(ptxgen ptxgen.c) 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}) @@ -43,3 +43,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 8b7cabeb..30d192a8 100644 --- a/Samples/7_libNVVM/simple/CMakeLists.txt +++ b/Samples/7_libNVVM/simple/CMakeLists.txt @@ -28,7 +28,8 @@ set(CMAKE_INSTALL_RPATH ${LIBNVVM_HOME}) set(CMAKE_INCLUDE_CURRENT_DIR YES) add_executable(simple simple.c) -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}) @@ -44,4 +45,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 440af90a..0f323058 100644 --- a/Samples/7_libNVVM/syscalls/CMakeLists.txt +++ b/Samples/7_libNVVM/syscalls/CMakeLists.txt @@ -26,12 +26,15 @@ 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 dfebf8f4..34d9bef0 100644 --- a/Samples/7_libNVVM/uvmlite/CMakeLists.txt +++ b/Samples/7_libNVVM/uvmlite/CMakeLists.txt @@ -30,7 +30,9 @@ set_property(SOURCE uvmlite.c PROPERTY COMPILE_DEFINITIONS LIBCUDADEVRT="${CUDADEVRT_LIB}") add_executable(uvmlite uvmlite.c) -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) @@ -47,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}")