#include <WorkGenerator.h>
|
| virtual std::pair< std::size_t, T > | generate (std::size_t n)=0 |
| | Generate the next n batches of work.
|
| |
◆ WorkGenerator() [1/3]
◆ WorkGenerator() [2/3]
◆ WorkGenerator() [3/3]
◆ ~WorkGenerator()
◆ generate()
template<typename T >
| virtual std::pair< std::size_t, T > generate |
( |
std::size_t | n | ) |
|
|
protectedpure virtual |
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.
- Parameters
-
| n | Number of batches to generate |
- Returns
- std::pair<std::size_t, T> Number of batches generated (
m) and the next m batches of work
Implemented in SliceGenerator, TensorLoader, and ValueMapLoader.
◆ has_more()
template<typename T >
| virtual bool has_more |
( |
| ) |
const |
|
pure virtual |
◆ next()
template<typename T >
| std::pair< std::size_t, T > next |
( |
std::size_t | n | ) |
|
|
inline |
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.
This is the public interface to the generator. Derived classes should implement WorkGenerator::generate.
- Parameters
-
| n | Number of batches to generator |
- Returns
- std::pair<std::size_t, T> Number of batches generated (
m) and the next m batches of work
◆ offset()
template<typename T >
| std::size_t offset |
( |
| ) |
const |
|
inline |
Return the current offset, i.e., the number of batches that have been generated.
◆ operator=() [1/2]
◆ operator=() [2/2]