

Check the toolchain settings to make sure that the selected architecture matches with the architecture of the installed CUDA toolkit (usually, amd64).Īll the. On Windows, CUDA projects can be developed only with the Microsoft Visual C++ toolchain. The options will include both general CMake targets and the targets created with cuda_add_executable/ cuda_add_library (see CUDA CMake language). If you want the new file to be automatically added to one or more CMake targets, select the Add to targets checkbox and choose the required targets from the list. cuh for a CUDA source or CUDA header, respectively. Right-click the desired folder in the Project tree and select New | C/C++ Source File or C/C++ Header File. See CMakeLists.txt file templates for details.ĬMake-based CUDA projects can be opened as regular CMake applications from the File | Open menu or from the CLion welcome screen.įor the case of a non-CMake CUDA project, you can generate a compilation database and then load it in CLion.
#Clion linux kernel code
You can edit the CMakeLists.txt template for CUDA projects in Settings / Preferences | Editor | File and Code Templates, the Other tab.

If you plan to add regular C/C++ files of another standard to your project, you will need to set the CMAKE_C_STANDARD/ CMAKE_CXX_STANDARD variable in the CMakeLists.txt script manually.Ĭlick Create, and CLion will generate a project with the sample CMakeLists.txt and main.cu: The selected standard will be set to the CMAKE_CUDA_STANDARD variable. Specify the project location, language standard, and library type as required. Go to File | New Project and select CUDA Executable or CUDA Library as your project type. Refer to the official documentation for details on the installation procedure.
#Clion linux kernel install
CUDA projects in CLionīefore you begin, make sure to install CUDA Development Toolkit. Also, CLion can help you create CMake-based CUDA applications with the New Project wizard. It provides C/C++ language extensions and APIs for working with CUDA-enabled GPUs.ĬLion supports CUDA C/C++ and provides it with code insight. CUDA (Compute Unified Device Architecture) is a parallel computing platform and programming model by NVidia.
