From 4e89d1abd412122bf4a5d28419b4728c6fbca0bf Mon Sep 17 00:00:00 2001 From: Mahinth Joe Christensen Date: Wed, 27 May 2026 13:35:13 +0530 Subject: [PATCH 1/2] =?UTF-8?q?Add=20CMakeUserPresets.json=20=E2=80=94=20c?= =?UTF-8?q?ontains=20local=20CMake=20configuration=20for=20Visual=20Studio?= =?UTF-8?q?=2018=20on=20Windows=2011=20(MZI=20Z790=20Pro,=2012GB=20RTX=203?= =?UTF-8?q?060)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- CMakeUserPresets.json | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 CMakeUserPresets.json 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 From 3de0538b5c39b99268b5e7237842750234d389b1 Mon Sep 17 00:00:00 2001 From: Mahinth Joe Christensen Date: Thu, 28 May 2026 11:10:26 +0530 Subject: [PATCH 2/2] Added CMakePresets --- CMakePresets.json | 49 ++++++++++++++++++++++++++++++++++ CMakeUserPresets.example.json | 50 +++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 CMakePresets.json create mode 100644 CMakeUserPresets.example.json 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