diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 000000000..143cbd9cd --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,49 @@ +{ + "version": 3, + "cmakeMinimumRequired": { "major": 3, "minor": 19 }, + "configurePresets": [ + { + "name": "windows-msvc", + "displayName": "Windows - Visual Studio (MSVC)", + "description": "Repository-level preset for Windows using Visual Studio generator.", + "generator": "Visual Studio 18 2026", + "architecture": "x64", + "binaryDir": "${sourceDir}/build/${presetName}" + }, + { + "name": "wsl-ninja", + "displayName": "WSL/Ubuntu - Ninja", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { "CMAKE_BUILD_TYPE": "Release" } + }, + { + "name": "linux-ninja", + "displayName": "Linux - Ninja", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { "CMAKE_BUILD_TYPE": "Release" } + }, + { + "name": "ci-linux", + "displayName": "CI Linux (Ubuntu LTS)", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/ci-linux", + "cacheVariables": { "CMAKE_BUILD_TYPE": "Release" } + }, + { + "name": "ci-windows", + "displayName": "CI Windows (MSVC)", + "generator": "Visual Studio 18 2026", + "architecture": "x64", + "binaryDir": "${sourceDir}/build/ci-windows" + } + ], + "buildPresets": [ + { "name": "build-windows-release", "configurePreset": "windows-msvc", "configuration": "Release" }, + { "name": "build-windows-debug", "configurePreset": "windows-msvc", "configuration": "Debug" }, + { "name": "build-linux-release", "configurePreset": "linux-ninja", "configuration": "Release" }, + { "name": "build-linux-debug", "configurePreset": "linux-ninja", "configuration": "Debug" }, + { "name": "build-ci-linux", "configurePreset": "ci-linux", "configuration": "Release" } + ] +} \ No newline at end of file diff --git a/CMakeUserPresets.example.json b/CMakeUserPresets.example.json new file mode 100644 index 000000000..2df4a200d --- /dev/null +++ b/CMakeUserPresets.example.json @@ -0,0 +1,50 @@ +{ + "version": 3, + "configurePresets": [ + { + "name": "msi-z790-windows11", + "displayName": "MSI Z790 - Windows 11 (MSVC)", + "description": "Example user preset for MSI Z790. Replace CUDA_TOOLKIT_ROOT_DIR with local path if needed.", + "generator": "Visual Studio 18 2026", + "architecture": "x64", + "binaryDir": "${sourceDir}/build/msi-z790-windows11", + "cacheVariables": { + "CUDA_TOOLKIT_ROOT_DIR": "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v13.2" + } + }, + { + "name": "msi-z790-wsl-ubuntu", + "displayName": "MSI Z790 - WSL Ubuntu", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/msi-z790-wsl-ubuntu", + "cacheVariables": { "CMAKE_BUILD_TYPE": "Release" } + }, + { + "name": "dell-windows10", + "displayName": "Dell Laptop - Windows 10 (MSVC)", + "generator": "Visual Studio 18 2026", + "architecture": "x64", + "binaryDir": "${sourceDir}/build/dell-windows10", + "cacheVariables": { "CMAKE_BUILD_TYPE": "Release" } + }, + { + "name": "dell-wsl-ubuntu", + "displayName": "Dell Laptop - WSL Ubuntu", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/dell-wsl-ubuntu", + "cacheVariables": { "CMAKE_BUILD_TYPE": "Release" } + }, + { + "name": "desktop-ubuntu", + "displayName": "Desktop - Ubuntu", + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/desktop-ubuntu", + "cacheVariables": { "CMAKE_BUILD_TYPE": "Release" } + } + ], + "buildPresets": [ + { "name": "build-msi-release", "configurePreset": "msi-z790-windows11", "configuration": "Release" }, + { "name": "build-msi-debug", "configurePreset": "msi-z790-windows11", "configuration": "Debug" }, + { "name": "build-wsl-msi-release", "configurePreset": "msi-z790-wsl-ubuntu", "configuration": "Release" } + ] +} \ No newline at end of file diff --git a/CMakeUserPresets.json b/CMakeUserPresets.json new file mode 100644 index 000000000..1af838ed1 --- /dev/null +++ b/CMakeUserPresets.json @@ -0,0 +1,42 @@ +{ + "version": 3, + "configurePresets": [ + { + "name": "cuda-13.2-msvc", + "displayName": "Visual Studio 2026 with CUDA 13.2 (x64)", + "description": "Configure for Visual Studio 2026 with CUDA 13.2 toolkit targeting x64 architecture", + "generator": "Visual Studio 18 2026", + "architecture": "x64", + "binaryDir": "${sourceDir}/build", + "cacheVariables": { + "CMAKE_TOOLCHAIN_CUDA": "13.2" + }, + "toolchainFile": null + } + ], + "buildPresets": [ + { + "name": "cuda-13.2-msvc-release", + "configurePreset": "cuda-13.2-msvc", + "configuration": "Release", + "jobs": 8 + }, + { + "name": "cuda-13.2-msvc-debug", + "configurePreset": "cuda-13.2-msvc", + "configuration": "Debug", + "jobs": 8 + } + ] +} +#How to Use It +## Configure the project: +###powershell +#### cd C:\Users\mahin\git\cuda-samples +#### cmake --preset cuda-13.2-msvc +# Build in Release mode: +# powershell +### cmake --build --preset cuda-13.2-msvc-release +# Build in Debug mode: +## powershell +### cmake --build --preset cuda-13.2-msvc-debug \ No newline at end of file