|
Graphitti
A toolkit/software architecture to ease creating high-performance neural network simulators
|


Public Member Functions | |
| EventBuffer (int maxEvents=0) | |
| int | getBufferFront () const |
| Accessor for the buffer front value. | |
| int | getBufferEnd () const |
| Accessor for the buffer end value. | |
| int | getEpochStart () const |
| Accessor for the epoch start value. | |
| int | getNumElementsInEpoch () const |
| void | setBufferFront (int bufferFront) |
| Mutator for the buffer front value. | |
| void | setBufferEnd (int bufferEnd) |
| Mutator for the buffer end value. | |
| void | setEpochStart (int epochStart) |
| Mutator for the epoch start value. | |
| void | setNumElementsInEpoch (int numElementsInEpoch) |
| Sets number of events in the current/preceding epoch. | |
| void | resize (int maxEvents) |
| } | |
| T | operator[] (int i) const |
| template<class Archive > | |
| void | serialize (Archive &archive) |
| Cereal serialization method. | |
Recorder Interface | |
virtual methods in RecordableBase for use by Recorder classes | |
| variantTypes | getElement (int index) const |
| int | getNumElements () const |
| Get the number of elements that needs to be recorded. | |
| void | startNewEpoch () |
Vertex and Edge Interface | |
EventBuffer interface for use by the Vertex and Edge classes | |
| void | clear () |
| int | size () |
| void | insertEvent (T timeStep) |
| T | getPastEvent (int offset) const |
Public Member Functions inherited from RecordableVector< T > | |
| RecordableVector () | |
| Constructor. | |
| virtual void | setDataType () override |
| virtual const std::string & | getDataType () const override |
| Get a string representing the data type of the recordable variable. | |
| virtual void | assign (size_t size, const T &value) |
| Assigns the given value to the vector for the specified size. | |
| T & | operator[] (int index) |
| Overload the operator to set the value at a specific index. | |
| void | push_back (const T &value) |
| Add a new value to recordable vector. | |
| const std::vector< T > & | getVector () const |
| Method to retrieve the underlying std::vector<T> | |
| T * | data () |
| Gets pointer to contiguous host memory array. | |
| const T * | data () const |
| Gets const pointer to contiguous host memory array. | |
| template<class Archive > | |
| void | serialize (Archive &archive) |
| Cereal serialization method. | |
Public Member Functions inherited from RecordableBase | |
| template<class Archive > | |
| void | serialize (Archive &archive) |
| Cereal serialization method. | |
Additional Inherited Members | |
Protected Member Functions inherited from RecordableBase | |
| RecordableBase ()=default | |
| prevents any code outside this class from creating a RecordableBase object | |
Protected Attributes inherited from RecordableVector< T > | |
| vector< T > | dataSeries_ |
| Holds the event time steps. | |
Protected Attributes inherited from RecordableBase | |
| std::string | basicDataType_ |
| the basic data type in the recorded variable | |
Definition at line 31 of file EventBuffer.h.
|
inline |
Create EventBuffer that is sized appropriately
Create and size the buffer so that it can hold a set number of events. Once an EventBuffer is created with a nonzero size, it should not be resized (generally, doing that will cause a major bug in the simulator). Note that the buffer size will be set to maxEvents+1, to distinguish between an empty and a full buffer.
| maxEvents | Defaults to zero; otherwise, buffer size is set |
Definition at line 41 of file EventBuffer.h.
|
inline |
Reset member variables consistent with an empty buffer
Definition at line 172 of file EventBuffer.h.
|
inline |
Accessor for the buffer end value.
Definition at line 91 of file EventBuffer.h.
|
inline |
Accessor for the buffer front value.
Definition at line 84 of file EventBuffer.h.
|
inlinevirtual |
Set up a string representing the basic data type Get the value of the recordable variable at the specified index.
| index | The index of the recorded value to retrieve. |
Reimplemented from RecordableVector< T >.
Definition at line 57 of file EventBuffer.h.
|
inline |
Accessor for the epoch start value.
Definition at line 98 of file EventBuffer.h.
|
inlinevirtual |
Get the number of elements that needs to be recorded.
Reimplemented from RecordableVector< T >.
Definition at line 63 of file EventBuffer.h.
|
inline |
Get number of events in the current/preceding epoch
Getting the number of events in the current epoch (or, in between epochs, the number of events in the preceding epoch) is not the same as the number of events in the buffer, because the buffer retains events from the previous epoch, too.
Definition at line 108 of file EventBuffer.h.
|
inline |
Get an event from a time in the past
Get the time step for an event in the past. An offset of -1 means the last event placed in the buffer; -2 means two events ago.
| offset | How many events ago. Must be negative. If that event isn't in the buffer, or if the buffer is empty, returns ULONG_MAX. |
Definition at line 212 of file EventBuffer.h.
|
inline |
Insert an event time step
Insert an event time step into the buffer (i.e., enqueue it in the circular array implementation of the queue).
| timeStep | Value to store in buffer |
Definition at line 194 of file EventBuffer.h.
|
inline |
Access event from current epoch
Access an element of the buffer as though it is an array or vector with element 0 being the first event in the epoch (element numElementsInEpoch_ - 1 would be the last element in the epoch).
| i | element number |
Definition at line 162 of file EventBuffer.h.
|
inlinevirtual |
}
Resize event buffer
Note that the buffer size will be set to maxEvents+1, to distinguish between an empty and a full buffer.
| maxEvents | Buffer size |
Reimplemented from RecordableVector< T >.
Definition at line 147 of file EventBuffer.h.
|
inline |
Cereal serialization method.
Definition at line 242 of file EventBuffer.h.
|
inline |
Mutator for the buffer end value.
Definition at line 122 of file EventBuffer.h.
|
inline |
Mutator for the buffer front value.
Setters are needed for copying from the GPU. Allows us to remove the friend keyword requirement. {
Definition at line 116 of file EventBuffer.h.
|
inline |
Mutator for the epoch start value.
Definition at line 128 of file EventBuffer.h.
|
inline |
Sets number of events in the current/preceding epoch.
Definition at line 134 of file EventBuffer.h.
|
inline |
Definition at line 182 of file EventBuffer.h.
|
inlinevirtual |
Start a new epoch
Resets the internal variables associated with tracking the events in a epoch. Note that this doesn't affect the contents of the buffer; it just resets things so that the epoch start is the index of the next event to be enqueued and that the number of events in the epoch is 0.
Reimplemented from RecordableVector< T >.
Definition at line 73 of file EventBuffer.h.