6#include "dawn/prog/common.hxx"
8#include "dawn/debug.hxx"
9#include "dawn/io/common.hxx"
10#include "dawn/io/ddata.hxx"
11#ifdef CONFIG_DAWN_IO_VIRT
12# include "dawn/io/virt.hxx"
42 return nbatch * nitems;
54 DAWNERR(
"target 0x%" PRIx32
" is not writable\n", io->
getIdV());
63#ifdef CONFIG_DAWN_IO_VIRT
66 return reinterpret_cast<CIOVirt *
>(io)->initialize(dim, batch, notify);
71 DAWNERR(
"virt target 0x%" PRIx32
" dimension mismatch: expected %zu got %zu\n",
80 DAWNERR(
"virt target 0x%" PRIx32
" notify mismatch: expected %d got %d\n",
87# ifdef CONFIG_DAWN_IO_NOTIFY
88 if (io->getNotifyBatch() != batch)
90 DAWNERR(
"virt target 0x%" PRIx32
" batch mismatch: expected %zu got %zu\n",
93 io->getNotifyBatch());
103 DAWNERR(
"virtIO target 0x%" PRIx32
" requires CONFIG_DAWN_IO_VIRT\n", io->
getIdV());
CBindableObject(CDescObject &desc)
Construct a CBindableObject from a descriptor.
Descriptor wrapper for individual object configuration.
SObjectId::UObjectId & getObjectId() const
Get object identifier as union structure.
Base class for all I/O objects.
virtual bool isWrite() const =0
Check if IO supports write operations.
virtual bool isNotify() const =0
Check if IO supports notifications.
virtual size_t getDataDim() const =0
Get data vector dimension.
@ IO_CLASS_VIRT
Virtual I/O.
Virtual I/O type for user-provided data and callbacks.
uint16_t getCls() const
Get object class field.
SObjectId::ObjectId getIdV() const
Get object identifier as raw 32-bit value.
int prepareWritableTarget(CIOCommon *io, size_t dim, bool notify, size_t batch=1)
Check a writable output; shape a deferred virt output or check an already shaped one.
@ PROG_CLASS_ANY
Generic PROG type.
CProgCommon(CDescObject &desc)
Constructor.
static size_t contiguousCount(io_ddata_t *d, size_t nbatch, size_t nitems)
Count elements of the first nbatch batches stored back to back.
Out-of-tree user-extension hooks for Dawn.
Heap-allocated dynamic I/O data buffer.
size_t getSize() const
Get element size in bytes.
size_t getItems()
Get number of items per batch.
uint32_t cls
Object class field (bits 21-29, max 511).
struct dawn::SObjectId::UObjectId::@305255014053264215072363020330017273014233040275 s
Bit-field structure for named member access.