Tannic
A C++ Tensor Library
Loading...
Searching...
No Matches
tannic::Host Class Reference

Host memory domain. More...

#include <resources.hpp>

Public Member Functions

 Host ()=default
 Constructs a host memory environment

 
void * allocate (std::size_t nbytes) const
 Allocates memory in host address space.
 
void deallocate (void *address, std::size_t nbytes) const
 Releases host memory resources.
 
int id () const
 Domain identifier constant.
 
bool pageable () const
 
bool pinned () const
 

Detailed Description

Host memory domain.

  • Primary memory space attached to the root execution environment
  • Manages the default address space for the main processor
  • Required for all operations in the root execution context
Warning
This class interface is experimental and likely to change as the backend evolves.

Constructor & Destructor Documentation

◆ Host()

tannic::Host::Host ( )
default

Constructs a host memory environment

Postcondition
Defaults to pageable allocation strategy

Member Function Documentation

◆ allocate()

void * tannic::Host::allocate ( std::size_t  nbytes) const

Allocates memory in host address space.

Parameters
nbytesContiguous memory block size in bytes
Returns
Pointer to allocated memory in host space
Precondition
nbytes > 0
Postcondition
Returned pointer is valid in host execution context

◆ deallocate()

void tannic::Host::deallocate ( void *  address,
std::size_t  nbytes 
) const

Releases host memory resources.

Parameters
addressBase pointer of allocation
nbytesSize of original allocation (for accounting)
Precondition
address points to valid host allocation
Postcondition
Memory is returned to host environment

◆ id()

int tannic::Host::id ( ) const
inline

Domain identifier constant.

Returns
Constant -1 representing the host domain

◆ pageable()

bool tannic::Host::pageable ( ) const
inline

◆ pinned()

bool tannic::Host::pinned ( ) const
inline

The documentation for this class was generated from the following file: