From 00969d867d251051bfa98bbd392e545a3e7367d6 Mon Sep 17 00:00:00 2001 From: Nicolas Morales Date: Wed, 2 Oct 2024 15:24:22 -0400 Subject: [PATCH] Make sure StaticExtentFromRange recognizes device-compatible integral_constant --- .../experimental/__p2630_bits/submdspan_extents.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/experimental/__p2630_bits/submdspan_extents.hpp b/include/experimental/__p2630_bits/submdspan_extents.hpp index c2aa6cde..f43876e8 100644 --- a/include/experimental/__p2630_bits/submdspan_extents.hpp +++ b/include/experimental/__p2630_bits/submdspan_extents.hpp @@ -302,6 +302,12 @@ struct StaticExtentFromRange, constexpr static size_t value = val1 - val0; }; +template +struct StaticExtentFromRange, + integral_constant> { + constexpr static size_t value = val1 - val0; +}; + // compute new static extent from strided_slice, preserving static // knowledge template struct StaticExtentFromStridedRange { @@ -314,6 +320,12 @@ struct StaticExtentFromStridedRange, constexpr static size_t value = val0 > 0 ? 1 + (val0 - 1) / val1 : 0; }; +template +struct StaticExtentFromStridedRange, + integral_constant> { + constexpr static size_t value = val0 > 0 ? 1 + (val0 - 1) / val1 : 0; +}; + // creates new extents through recursive calls to next_extent member function // next_extent has different overloads for different types of stride specifiers template