13#include "dawn/io/idata.hxx"
14#include "dawn/porting/config.hxx"
20template<
typename T,
size_t N>
29template<
typename T,
size_t N>
37template<
typename T,
size_t N,
size_t M = 1,
bool TS = false>
49 assert(
sizeof(T) == 1 ||
sizeof(T) == 2 ||
sizeof(T) == 4 ||
sizeof(T) == 8);
64 return data[batch].data[index];
105 return sizeof(this->
data);
116 return sizeof(T) * N;
126 constexpr void *
getPtr(
size_t batch = 0)
override
128 return (
void *)&
data[batch];
140 return (
void *)&
data[batch];
166template<
typename T,
size_t N,
size_t M>
178 assert(
sizeof(T) == 1 ||
sizeof(T) == 2 ||
sizeof(T) == 4 ||
sizeof(T) == 8);
193 return data[batch].data[index];
206 return data[batch].ts;
234 return sizeof(this->
data);
245 return sizeof(T) * N;
255 constexpr void *
getPtr(
size_t batch = 0)
override
257 return (
void *)&
data[batch];
269 return (
void *)
data[batch].data;
288 return data[batch].ts;
Out-of-tree user-extension hooks for Dawn.
uint64_t io_ts_t
Timestamp data type (uint64_t, typically microseconds since boot).
Single batch of I/O data without timestamp.
T data[N]
Data elements (N items of type T)
Single batch of I/O data with timestamp.
T data[N]
Data elements (N items of type T)
io_ts_t ts
Timestamp for this measurement.
bool hasTimestamp()
This buffer has per-batch timestamp.
size_t getDataSize()
Get data size in bytes.
static size_t getBatch()
Get number of batches.
void * getDataPtr(size_t batch=0)
Get pointer to data only (skips timestamp).
io_ts_t & operator[](size_t batch)
Get timestamp for batch.
static size_t getSize()
Get element size in bytes.
void * getPtr(size_t batch=0)
Get pointer to batch (timestamp + data).
size_t getBufferSize() const
Get total buffer size in bytes.
io_sdata_t()
Constructor - initialize all data to zero.
T & operator()(size_t index, size_t batch=0)
Get data element by index and batch.
size_t getItems()
Get number of items per batch.
io_ts_t & getTs(size_t batch=0)
Get timestamp reference for batch.
Static (compile-time) I/O data buffer (no timestamp).
io_ts_t & operator[](size_t batch)
Get timestamp (returns shared dummy).
size_t getItems()
Get number of items per batch.
void * getDataPtr(size_t batch=0)
Get pointer to data only (same as getPtr for no-timestamp).
io_sdata_t()
Constructor - initialize all data to zero.
io_ts_t & getTs(size_t batch=0)
Get timestamp reference (returns shared dummy).
io_ts_t dummyTs
Dummy timestamp for API compatibility.
bool hasTimestamp()
This buffer has no per-batch timestamp.
io_data_nots_s< T, N > data[M]
Array of M batches (each: N elements, no timestamp)
size_t getDataSize()
Get data size in bytes.
static size_t getSize()
Get element size in bytes.
size_t getBufferSize() const
Get total buffer size in bytes.
static size_t getBatch()
Get number of batches.
void * getPtr(size_t batch=0)
Get pointer to batch (data only, no timestamp).
T & operator()(size_t index, size_t batch=0)
Get data element by index and batch.