One more option is that you can be able to add the following components to your CMakeLists.txt file just before cuda_add_executable(test). I have checked this and it performs very well on my mac (OSX 10.5, CUDA 3.0, CMake 2.8.0). Just one thing should be remembered that this may not work with future versions of CUDA where emulation is properly and permanently removed.
Code:
if(CUDA_VERSION VERSION_GREATER "2.3")
find_library_local_first(CUDA_CUDARTEMU_LIBRARY cudartemu "\"cudartemu\" library")
if(CUDA_BUILD_EMULATION)
set(CUDA_LIBRARIES ${CUDA_CUDARTEMU_LIBRARY})
if(APPLE)
get_filename_component(_cuda_path_to_cudart "${CUDA_CUDARTEMU_LIBRARY}" PATH)
if(_cuda_path_to_cudart)
list(APPEND CUDA_LIBRARIES -Wl,-rpath "-Wl,${_cuda_path_to_cudart}")
endif()
endif()
if (CUDA_CUDA_LIBRARY)
set(CUDA_LIBRARIES ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY})
endif(CUDA_CUDA_LIBRARY)
mark_as_advanced(
CUDA_CUDARTEMU_LIBRARY
)
endif()
endif()
Bookmarks