NEML2 2.0.0
|
#include <SliceGenerator.h>
Public Member Functions | |
SliceGenerator (std::size_t start, std::size_t stop) | |
std::size_t | total () const override |
Total (fixed) number of batches that will be generated. | |
![]() | |
bool | has_more () const override |
Whether the generator has more work to generate. | |
![]() | |
WorkGenerator ()=default | |
WorkGenerator (WorkGenerator &&) noexcept=default | |
WorkGenerator (const WorkGenerator &)=default | |
WorkGenerator & | operator= (WorkGenerator &&) noexcept=default |
WorkGenerator & | operator= (const WorkGenerator &)=default |
virtual | ~WorkGenerator ()=default |
std::pair< std::size_t, indexing::Slice > | next (std::size_t n) |
Generate the next n batches of work. | |
std::size_t | offset () const |
Return the current offset, i.e., the number of batches that have been generated. | |
Protected Member Functions | |
std::pair< std::size_t, indexing::Slice > | generate (std::size_t n) override |
Generate the next n batches of work. | |
SliceGenerator | ( | std::size_t | start, |
std::size_t | stop ) |
|
overrideprotectedvirtual |
Generate the next n
batches of work.
Note that in the case of insufficient remaining work, it is possible that the number of batches generated is less than n
.
n | Number of batches to generate |
m
) and the next m
batches of work Implements WorkGenerator< indexing::Slice >.
|
overridevirtual |
Total (fixed) number of batches that will be generated.
Implements FixedSizeWorkGenerator< indexing::Slice >.