class nbla::Array
-
class Array : public std::enable_shared_from_this<Array>
An abstract class of Array interface.Shared pointer of NdArray.
This is extended to implement a new array class (see CpuArray, CudaArray etc.).
Subclassed by nbla::CpuArray, nbla::DlpackArray
Public Functions
-
inline AllocatorMemoryPtr memory() const
Get shared pointer of the AllocatorMemory.
- virtual NBLA_API void zero ()=0
Fill all element with zero.
- virtual NBLA_API void fill (float value)=0
Fill all element with given value.
- virtual NBLA_API void set_event (EventPtr eptr)
Set an event.
- virtual NBLA_API void wait_event (const Context ctx, const int async_flags=AsyncFlag::NONE)
Wait for the end of an event.
- Parameters:
ctx – Context where the event is waited for.
async_flags – .
- virtual NBLA_API bool have_event ()
Check an event exist.
- virtual NBLA_API Ptr getptr ()
Get shared_ptr of this object.
-
inline AllocatorMemoryPtr memory() const