From b087c806fe9cc350c8932f34b4e2913332f540ae Mon Sep 17 00:00:00 2001 From: "M. Chornyi" <99709299+mc-nv@users.noreply.github.com> Date: Wed, 9 Sep 2026 20:36:01 +0000 Subject: [PATCH 1/2] build: Update C++ standard from c++17 to c++20 Upstream PyTorch raised ATen's minimum required C++ standard from 17 to 20 (pytorch/pytorch#178150), which broke the pytorch_backend build. Align this repo's TRITON_MIN_CXX_STANDARD/CMAKE_CXX_STANDARD default with that floor for consistency across the stack. TRI-1877 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0fb8595..3782de3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,8 +28,8 @@ cmake_minimum_required (VERSION 3.31.8) project(tritonpytorchbackend LANGUAGES C CXX) -# Use C++17 standard as Triton's minimum required. -set(TRITON_MIN_CXX_STANDARD 17 CACHE STRING "The minimum C++ standard which features are requested to build this target.") +# Use C++20 standard as Triton's minimum required. +set(TRITON_MIN_CXX_STANDARD 20 CACHE STRING "The minimum C++ standard which features are requested to build this target.") # # Options From fa172d8a8bbf97ef2858e29090dcf233310e7d22 Mon Sep 17 00:00:00 2001 From: "M. Chornyi" <99709299+mc-nv@users.noreply.github.com> Date: Thu, 10 Sep 2026 18:06:06 +0000 Subject: [PATCH 2/2] fix: raise stale cached TRITON_MIN_CXX_STANDARD to the new C++20 floor --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3782de3..bc9a651 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,14 @@ cmake_minimum_required (VERSION 3.31.8) project(tritonpytorchbackend LANGUAGES C CXX) # Use C++20 standard as Triton's minimum required. -set(TRITON_MIN_CXX_STANDARD 20 CACHE STRING "The minimum C++ standard which features are requested to build this target.") +# A stale CMake cache from a build tree configured before this bump would +# otherwise keep TRITON_MIN_CXX_STANDARD at its old cached value, so raise it +# to the new floor while still allowing a user to cache a higher override. +if(DEFINED TRITON_MIN_CXX_STANDARD AND TRITON_MIN_CXX_STANDARD LESS 20) + set(TRITON_MIN_CXX_STANDARD 20 CACHE STRING "The minimum C++ standard which features are requested to build this target." FORCE) +else() + set(TRITON_MIN_CXX_STANDARD 20 CACHE STRING "The minimum C++ standard which features are requested to build this target.") +endif() # # Options