![]() |
Shamrock 2025.10.0
Astrophysical Code
|
A class template for creating a mirrored buffer. More...
#include <shambackends/include/shambackends/BufferMirror.hpp>
Public Member Functions | |
| BufferMirror (DeviceBuffer< T, orgin_target > &mirrored_buffer) | |
| Constructs a BufferMirror. | |
| BufferMirror (const BufferMirror &)=delete | |
| BufferMirror (BufferMirror &&)=delete | |
| BufferMirror & | operator= (const BufferMirror &)=delete |
| BufferMirror & | operator= (BufferMirror &&)=delete |
| T * | data () const |
| Provides access to the mirrored data. | |
| u32 | size () const |
| Returns the size of the mirrored buffer. | |
| T & | operator[] (u32 i) const |
| Accesses the mirrored data at a given index. | |
| ~BufferMirror () | |
| Destructor. | |
A class template for creating a mirrored buffer.
This class provides a mechanism to create a mirrored buffer of a specific DeviceBuffer that can be accessed like a normal pointer.
Example of usage :
| T | The type of elements in the buffer |
| target | The USM kind target for the mirror buffer |
| orgin_target | The original USM kind target of the mirrored buffer |
Definition at line 51 of file BufferMirror.hpp.
|
inline |
Constructs a BufferMirror.
Initializes the mirrored buffer of the original data and retain a reference to the original buffer
| mirrored_buffer | The original buffer to be mirrored |
Definition at line 67 of file BufferMirror.hpp.
Here is the call graph for this function:
|
inline |
Destructor.
Copies the data from the mirror back to the original buffer.
Definition at line 107 of file BufferMirror.hpp.
Here is the call graph for this function:
|
inline |
Provides access to the mirrored data.
Definition at line 85 of file BufferMirror.hpp.
|
inline |
Accesses the mirrored data at a given index.
| i | Index of the data to access |
Definition at line 100 of file BufferMirror.hpp.
|
inline |
Returns the size of the mirrored buffer.
Definition at line 92 of file BufferMirror.hpp.