Compile CUDA and C++ in CLion with MSVC

31 Views Asked by At

I've just begun a small project in CUDA.

I need to know the following: Is it possible to compile CUDA library and CPP in the same project? When I try find_package(CUDA REQUIRED), the error says that it couldn't find 'FindCUDA.cmake'

src/Main.cpp: Entry point
src/module.cu: CUDA script with implementation
src/module.cuh: Declaration part of the CUDA script.

From Main.cpp, kernel.cuh is included. The module itself runs as an independent library, and we want to use it from Main.

My Env:

  • Windows 11,
  • RTX 4070 Ti,
  • CUDA Toolkit 12.4
  • CLion

I need to know the following: Is it possible to compile CUDA library and CPP in the same project?

0

There are 0 best solutions below