Contents

struct

SushiRuntime::Extent

template <int N>

Describes the iteration shape of a fluent kernel: an N-D box with an origin.

Declared in
include/SushiRuntime/api/launch/extent.hpp

Template parameters

N

Number of dimensions (1, 2, or 3), matching SYCL's range rank.

See also

include/SushiRuntime/api/launch/README.md

Public attributes

sycl::range< N > extent

Work-items per dimension.

sycl::id< N > offset = sycl::id<N>{}

Origin of the iterated box.

Public member functions

template <int M = N, std::enable_if_t< M==1, int > = 0>
Extent(std::size_t n)

A 1-D extent from a plain element count (offset 0).

Parameters

n

Number of work-items to iterate.

template <class... Sizes, std::enable_if_t< N > = 2 && sizeof...(Sizes) == N && (std::is_convertible_v<Sizes, std::size_t> && ...), int>
Extent(Sizes... sizes)

An extent from explicit per-dimension sizes (offset 0).

Parameters

sizes

Exactly N work-item counts, one per dimension, in SYCL order (slowest-varying first).

explicit Extent(sycl::range< N > r)

An extent from a SYCL range, offset 0.

Parameters

r

Work-items per dimension.

Extent(sycl::range< N > r, sycl::id< N > o)

An extent from a SYCL range and an explicit origin.

Parameters

r

Work-items per dimension.

o

Index of the first work-item, so the kernel iterates a sub-box.

std::size_t count() const noexcept

Reports how much work this shape represents.

Returns

Total work-items, the product of the per-dimension sizes.

Extent at(sycl::id< N > origin) const noexcept

Rebases the same box at a different origin.

Parameters

origin

Index of the first work-item in the returned extent.

Returns

A copy with this extent's sizes and the given origin.