mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2025-04-04 07:21:33 +01:00
Merge pull request #18 from jnbntz/nvvm_updates
changing to CMAKE_CURRENT_BINARY_DIR for the copy of input files
This commit is contained in:
commit
c7bfd4418b
@ -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
|
||||
|
@ -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}")
|
||||
|
@ -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}")
|
||||
|
@ -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}")
|
||||
|
@ -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}")
|
||||
|
@ -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}")
|
||||
|
@ -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}")
|
||||
|
Loading…
x
Reference in New Issue
Block a user