|
UraniumCompute 0.1.0
A GPU accelerated parallel task scheduler
|
Helper class for memory mapping, implements indexing operators and bound checking. More...
#include <IDeviceMemory.h>
Public Member Functions | |
| MemoryMapHelper (MemoryMapHelper &&other) noexcept | |
| T & | operator[] (USize index) |
| UInt64 | Length () const |
| Get size of the mapped data as a number of elements of type T. | |
| UInt64 | ByteSize () const |
| Get size of the mapped data in bytes. | |
| bool | IsValid () const |
| Check if an instance of the class is in valid state. | |
| operator bool () const | |
| Check if an instance of the class is in valid state. | |
| T * | Data () const |
| Get a pointer to the mapped memory. | |
| T * | begin () |
| T * | end () |
Static Public Member Functions | |
| static MemoryMapHelper | Map (const DeviceMemorySlice &memorySlice) |
| Map the device memory slice. More... | |
| static MemoryMapHelper | Map (IDeviceMemory *pMemory, UInt64 byteOffset=0, UInt64 byteSize=IDeviceMemory::WholeSize) |
| Map the device memory. More... | |
Helper class for memory mapping, implements indexing operators and bound checking.
|
inlinestatic |
Map the device memory slice.
The function returns an instance of MemoryMapHelper that can be invalid if the memory map operation did not succeed. Check it like this:
| memorySlice | - The device memory slice to map. |
|
inlinestatic |
Map the device memory.
The function returns an instance of MemoryMapHelper that can be invalid if the memory map operation did not succeed. Check it like this:
| pMemory | - The device memory to map. |
| byteOffset | - Byte offset of the memory to map. |
| byteSize | - Size of the part of the memory to map. |