Configure CMake to configure CUDA on Windows

I am trying to use CMake to compile a CUDA-based application on Windows (Visual Studio 2005). Here is an example taken from a CMake file:

cmake_minimum_required (VERSION 2.6)
project (HELLO)

#Support for CUDA Integration
FIND_PACKAGE(CUDA)
if(CUDA_FOUND)
    SET(CUDA_NVCC_FLAGS "-arch;sm_13")
CUDA_ADD_EXECUTABLE(Hello hello.cu)
else(CUDA_FOUND)
    message("CUDA is not installed on this system.")
endif()

There are a few questions that I want to understand.

When I open the solution file (Hello.sln), I don’t see the settings for the custom assembly rule for the project (right-click on the project → custom assembly rules)

I see "Hello_generated_hello.cu.obj" added to my project in Visual Studio. What is this file and why is it added to the project?

By default, the CUDA Runtime API is not part of the project properties.

(NvCudaRuntimeApi.rules), API CUDA runtime. GPU, , GPU - sm_10.

CUDA_INCLUDE_DIRECTORIES() CUDA, Project Properties → CUDA Runtime API → General → Additional Include Directories.

, FindCUDA() VS 2005 CUDA. , . , , . , , CMakeLists, VS 2005.

?

+5
1

CMake (, API- CUDA runtime API.rules), CUDA, .rules, CMake . CUDA CMakeLists.txt, , .

FindCUDA ( -) , , , CUDA.cu Visual Studio ( .rules).

CMake CUDA CUDPP :

, .

+4

All Articles