Device memory domain.
More...
#include <resources.hpp>
|
| | Device (int id=0, bool blocking=false) |
| | Constructs a device memory environment.
|
| |
| void * | allocate (std::size_t nbytes) const |
| | Allocates device memory
|
| |
| void | deallocate (void *address, std::size_t nbytes) const |
| | Releases device memory.
|
| |
| int | id () const noexcept |
| | Device identifier.
|
| |
| bool | blocking () const |
| |
Device memory domain.
- Secondary memory space attached to a compute accelerator
- Requires explicit data transfer from host domain
- Allocation strategies may vary by device capabilities
- Memory operations are asynchronous by default
- Each instance manages a single logical device
- Warning
- Device memory management is highly likely to change as the backend evolves.
◆ Device()
| tannic::Device::Device |
( |
int |
id = 0, |
|
|
bool |
blocking = false |
|
) |
| |
Constructs a device memory environment.
- Parameters
-
| id | Target device identifier (0-based) |
| blocking | Enable synchronous operation mode |
◆ allocate()
| void * tannic::Device::allocate |
( |
std::size_t |
nbytes | ) |
const |
Allocates device memory
- Parameters
-
| nbytes | Contiguous memory block size in bytes |
- Returns
- Device pointer valid in target domain
◆ blocking()
| bool tannic::Device::blocking |
( |
| ) |
const |
|
inline |
◆ deallocate()
| void tannic::Device::deallocate |
( |
void * |
address, |
|
|
std::size_t |
nbytes |
|
) |
| const |
Releases device memory.
- Parameters
-
◆ id()
| int tannic::Device::id |
( |
| ) |
const |
|
inlinenoexcept |
Device identifier.
- Returns
- Non-negative device index
The documentation for this class was generated from the following file: