Fix issue with native CUDA hardware detection

To detect what CUDA hardware is native, a simple CUDA program is
compiled. However, CMake was not necessarily pointing to the correct
source file, so the compile was failing.

This change makes sure that VTKm_CMAKE_MODULE_PATH is properly set and
uses that variable to find the source file.
This commit is contained in:
Kenneth Moreland 2016-06-23 11:34:23 -06:00
parent eb41c6d5bd
commit ca0bafa479
3 changed files with 4 additions and 3 deletions

@ -48,7 +48,7 @@ set(VTKm_REQUIRED_BOOST_VERSION "@VTKm_REQUIRED_BOOST_VERSION@")
if(NOT VTKm_PACKAGE_IN_BUILD)
set_and_check(VTKm_CMAKE_MODULE_PATH "@PACKAGE_VTKm_INSTALL_CMAKE_MODULE_DIR@")
else()
set(VTKm_CMAKE_MODULE_PATH "@VTKm_SOURCE_DIR@/CMake")
set_and_check(VTKm_CMAKE_MODULE_PATH "@VTKm_SOURCE_DIR@/CMake")
endif()
set(VTKm_ENABLE_CUDA "@VTKm_ENABLE_CUDA@")

@ -242,7 +242,7 @@ macro(vtkm_configure_component_CUDA)
if(VTKm_CUDA_Architecture STREQUAL "native")
#run execute_process to do auto_detection
set(command ${CUDA_NVCC_EXECUTABLE})
set(args "-ccbin" "${CMAKE_CXX_COMPILER}" "--run" "${CMAKE_CURRENT_LIST_DIR}/VTKmDetectCUDAVersion.cxx")
set(args "-ccbin" "${CMAKE_CXX_COMPILER}" "--run" "${VTKm_CMAKE_MODULE_PATH}/VTKmDetectCUDAVersion.cxx")
execute_process(
COMMAND ${command} ${args}
RESULT_VARIABLE ran_properly

@ -50,7 +50,8 @@ set(VTKm_INSTALL_CMAKE_MODULE_DIR "share/vtkm/cmake")
set(VTKm_REQUIRED_BOOST_VERSION "1.48")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${VTKm_SOURCE_DIR}/CMake)
set(VTKm_CMAKE_MODULE_PATH ${VTKm_SOURCE_DIR}/CMake)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${VTKm_CMAKE_MODULE_PATH})
# include some vtkm-specific cmake code.
include(VTKmMacros)