docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
sdfg::types::StorageType Class Reference

Represents the storage location and management characteristics of data. More...

#include <sdfg/types/type.h>

Public Types

enum  AllocationType { Unmanaged , Managed }
 Defines how memory allocation/deallocation is managed. More...

Public Member Functions

 StorageType (const std::string &value)
 Constructs a StorageType with default unmanaged allocation.
 StorageType (const std::string &value, const symbolic::Expression &allocation_size, AllocationType allocation, AllocationType deallocation)
 Constructs a StorageType with explicit allocation management.
std::string value () const
 Gets the storage location identifier.
void value (const std::string &value)
 Sets the storage location identifier.
symbolic::Expression allocation_size () const
 Gets the allocation size.
void allocation_size (const symbolic::Expression &allocation_size)
 Sets the allocation size.
const symbolic::Expression & arg1 () const
 Gets the additional argument.
void arg1 (const symbolic::Expression &arg)
 Sets the additional argument.
std::vector< symbolic::Expression > & args ()
const std::vector< symbolic::Expression > & args () const
void args (const std::vector< symbolic::Expression > &args)
void args (std::vector< symbolic::Expression > &&args)
AllocationType allocation () const
 Gets the allocation management type.
void allocation (AllocationType allocation)
 Sets the allocation management type.
AllocationType deallocation () const
 Gets the deallocation management type.
void deallocation (AllocationType deallocation)
 Sets the deallocation management type.
bool operator== (const StorageType &other) const
 Compares two StorageType objects for equality.
bool is_cpu_stack () const
 Checks if this storage is CPU stack storage.
bool is_cpu_heap () const
 Checks if this storage is CPU heap storage.
bool is_device () const
 Checks if this storage resides on a device (i.e. not CPU stack/heap).
bool is_nv_generic () const
 Checks if this storage is NVIDIA generic memory.
bool is_amd_generic () const
 Checks if this storage is AMD generic memory.
bool is_nv_global () const
 Checks if this storage is NVIDIA global memory.
bool is_nv_shared () const
 Checks if this storage is NVIDIA shared memory.
bool is_nv_constant () const
 Checks if this storage is NVIDIA constant memory.
bool is_nv_symbol () const
 Checks if this storage is an NVIDIA symbol.
bool is_gpu_static () const
 Checks if this storage is a static GPU buffer.

Static Public Member Functions

static StorageType CPU_Stack ()
 Creates a CPU stack storage type.
static StorageType CPU_Heap ()
 Creates a CPU heap storage type with default unmanaged allocation.
static StorageType CPU_Heap (symbolic::Expression allocation_size, StorageType::AllocationType allocation, StorageType::AllocationType deallocation)
 Creates a CPU heap storage type with explicit allocation management.
static StorageType NV_Generic ()
 Creates an NVIDIA generic memory storage type.
static StorageType NV_Global ()
 Creates an NVIDIA global memory storage type.
static StorageType NV_Shared ()
 Creates an NVIDIA shared memory storage type.
static StorageType NV_Constant ()
 Creates an NVIDIA constant memory storage type.
static StorageType NV_Symbol ()
 Creates an NVIDIA symbol storage type.
static StorageType GPU_Static ()
 Creates a static GPU buffer storage type (see is_gpu_static).

Detailed Description

Represents the storage location and management characteristics of data.

StorageType defines where data is stored (e.g., CPU stack, CPU heap, GPU memory) and how its allocation and deallocation are managed.

Member Enumeration Documentation

◆ AllocationType

Defines how memory allocation/deallocation is managed.

Enumerator
Unmanaged 

Memory is not automatically managed.

Managed 

Memory is automatically managed.

Constructor & Destructor Documentation

◆ StorageType() [1/2]

sdfg::types::StorageType::StorageType ( const std::string & value)
inline

Constructs a StorageType with default unmanaged allocation.

Parameters
valueThe storage location identifier

◆ StorageType() [2/2]

sdfg::types::StorageType::StorageType ( const std::string & value,
const symbolic::Expression & allocation_size,
AllocationType allocation,
AllocationType deallocation )
inline

Constructs a StorageType with explicit allocation management.

Parameters
valueThe storage location identifier
allocation_sizeThe size to allocate
allocationThe allocation management type
deallocationThe deallocation management type

Member Function Documentation

◆ allocation() [1/2]

AllocationType sdfg::types::StorageType::allocation ( ) const
inline

Gets the allocation management type.

◆ allocation() [2/2]

void sdfg::types::StorageType::allocation ( AllocationType allocation)
inline

Sets the allocation management type.

◆ allocation_size() [1/2]

symbolic::Expression sdfg::types::StorageType::allocation_size ( ) const
inline

Gets the allocation size.

◆ allocation_size() [2/2]

void sdfg::types::StorageType::allocation_size ( const symbolic::Expression & allocation_size)
inline

Sets the allocation size.

◆ arg1() [1/2]

const symbolic::Expression & sdfg::types::StorageType::arg1 ( ) const
inline

Gets the additional argument.

◆ arg1() [2/2]

void sdfg::types::StorageType::arg1 ( const symbolic::Expression & arg)
inline

Sets the additional argument.

◆ args() [1/4]

std::vector< symbolic::Expression > & sdfg::types::StorageType::args ( )
inline

◆ args() [2/4]

const std::vector< symbolic::Expression > & sdfg::types::StorageType::args ( ) const
inline

◆ args() [3/4]

void sdfg::types::StorageType::args ( const std::vector< symbolic::Expression > & args)
inline

◆ args() [4/4]

void sdfg::types::StorageType::args ( std::vector< symbolic::Expression > && args)
inline

◆ CPU_Heap() [1/2]

StorageType sdfg::types::StorageType::CPU_Heap ( )
inlinestatic

Creates a CPU heap storage type with default unmanaged allocation.

Returns
StorageType configured for CPU heap with unmanaged allocation

◆ CPU_Heap() [2/2]

StorageType sdfg::types::StorageType::CPU_Heap ( symbolic::Expression allocation_size,
StorageType::AllocationType allocation,
StorageType::AllocationType deallocation )
inlinestatic

Creates a CPU heap storage type with explicit allocation management.

Parameters
allocation_sizeThe size to allocate
allocationThe allocation management type
deallocationThe deallocation management type
Returns
StorageType configured for CPU heap with specified allocation management

◆ CPU_Stack()

StorageType sdfg::types::StorageType::CPU_Stack ( )
inlinestatic

Creates a CPU stack storage type.

Returns
StorageType configured for CPU stack with unmanaged allocation

◆ deallocation() [1/2]

AllocationType sdfg::types::StorageType::deallocation ( ) const
inline

Gets the deallocation management type.

◆ deallocation() [2/2]

void sdfg::types::StorageType::deallocation ( AllocationType deallocation)
inline

Sets the deallocation management type.

◆ GPU_Static()

StorageType sdfg::types::StorageType::GPU_Static ( )
inlinestatic

Creates a static GPU buffer storage type (see is_gpu_static).

◆ is_amd_generic()

bool sdfg::types::StorageType::is_amd_generic ( ) const
inline

Checks if this storage is AMD generic memory.

◆ is_cpu_heap()

bool sdfg::types::StorageType::is_cpu_heap ( ) const
inline

Checks if this storage is CPU heap storage.

◆ is_cpu_stack()

bool sdfg::types::StorageType::is_cpu_stack ( ) const
inline

Checks if this storage is CPU stack storage.

◆ is_device()

bool sdfg::types::StorageType::is_device ( ) const
inline

Checks if this storage resides on a device (i.e. not CPU stack/heap).

◆ is_gpu_static()

bool sdfg::types::StorageType::is_gpu_static ( ) const
inline

Checks if this storage is a static GPU buffer.

A static GPU buffer is a fixed-size device array with program lifetime: it is defined once at file scope of each kernel translation unit using it, zero-initialized when the module is loaded, persists across kernel launches and is never passed as a kernel argument nor materialized on the host.

◆ is_nv_constant()

bool sdfg::types::StorageType::is_nv_constant ( ) const
inline

Checks if this storage is NVIDIA constant memory.

◆ is_nv_generic()

bool sdfg::types::StorageType::is_nv_generic ( ) const
inline

Checks if this storage is NVIDIA generic memory.

◆ is_nv_global()

bool sdfg::types::StorageType::is_nv_global ( ) const
inline

Checks if this storage is NVIDIA global memory.

◆ is_nv_shared()

bool sdfg::types::StorageType::is_nv_shared ( ) const
inline

Checks if this storage is NVIDIA shared memory.

◆ is_nv_symbol()

bool sdfg::types::StorageType::is_nv_symbol ( ) const
inline

Checks if this storage is an NVIDIA symbol.

◆ NV_Constant()

StorageType sdfg::types::StorageType::NV_Constant ( )
inlinestatic

Creates an NVIDIA constant memory storage type.

◆ NV_Generic()

StorageType sdfg::types::StorageType::NV_Generic ( )
inlinestatic

Creates an NVIDIA generic memory storage type.

◆ NV_Global()

StorageType sdfg::types::StorageType::NV_Global ( )
inlinestatic

Creates an NVIDIA global memory storage type.

◆ NV_Shared()

StorageType sdfg::types::StorageType::NV_Shared ( )
inlinestatic

Creates an NVIDIA shared memory storage type.

◆ NV_Symbol()

StorageType sdfg::types::StorageType::NV_Symbol ( )
inlinestatic

Creates an NVIDIA symbol storage type.

◆ operator==()

bool sdfg::types::StorageType::operator== ( const StorageType & other) const
inline

Compares two StorageType objects for equality.

Parameters
otherThe StorageType to compare with
Returns
true if the storage types are equal, false otherwise

◆ value() [1/2]

std::string sdfg::types::StorageType::value ( ) const
inline

Gets the storage location identifier.

◆ value() [2/2]

void sdfg::types::StorageType::value ( const std::string & value)
inline

Sets the storage location identifier.


The documentation for this class was generated from the following file:
  • sdfg/include/sdfg/types/type.h