11 namespace onnxruntime {
37 return gsl::span<P>(p,
s);
57 constexpr
auto AsSpan(std::initializer_list<T>
c) {
61 template <
class T,
size_t N>
66 template <
class T,
size_t N>
67 constexpr
auto AsSpan(
const T (&arr)[
N]) {
72 inline gsl::span<const T>
EmptySpan() {
return gsl::span<const T>(); }
74 template <
class U,
class T>
78 Expects(src.size_bytes() %
sizeof(U) == 0);
79 return gsl::span<U>(
reinterpret_cast<U*
>(src.data()), src.size_bytes() /
sizeof(U));
83 return gsl::span<const std::byte>(
reinterpret_cast<const std::byte*
>(
data), length);
86 template <
class T1,
size_t Extent1,
class T2,
size_t Extent2>
87 [[nodiscard]]
inline bool SpanEq(gsl::span<T1, Extent1>
a, gsl::span<T2, Extent2>
b) {
88 static_assert(std::is_same_v<std::remove_const_t<T1>, std::remove_const_t<T2>>,
89 "T1 and T2 should be the same type except for const qualification");
90 return std::equal(a.begin(), a.end(), b.begin(), b.end());
constexpr auto AsSpan(C &c)
GLboolean GLboolean GLboolean GLboolean a
GLuint GLsizei GLsizei * length
IMATH_HOSTDEVICE constexpr bool equal(T1 a, T2 b, T3 t) IMATH_NOEXCEPT
gsl::span< const T > EmptySpan()
GLboolean GLboolean GLboolean b
constexpr auto AsSpanImpl(P *p, size_t s)
gsl::span< U > ReinterpretAsSpan(gsl::span< T > src)
GA_API const UT_StringHolder N
gsl::span< const std::byte > AsByteSpan(const void *data, size_t length)
bool SpanEq(gsl::span< T1, Extent1 > a, gsl::span< T2, Extent2 > b)