Class CurveRTCHost

Class Documentation

class CurveRTCHost

A cuRVE instance.

The Curve RTC host is a class for dynamically building a header file for use in RTC functions. Rather than providing a hashmap of string variable names it will dynamically create a header with agent variables directly accessible via compile time string comparisons.

Public Functions

CurveRTCHost()
~CurveRTCHost()
void registerAgentVariable(const char *variableName, unsigned int namespace_hash, const char *type, size_t type_size, unsigned int elements = 1, bool read = true, bool write = true)
void registerMessageOutVariable(const char *variableName, unsigned int namespace_hash, const char *type, size_t type_size, unsigned int elements = 1, bool read = true, bool write = true)
void registerMessageInVariable(const char *variableName, unsigned int namespace_hash, const char *type, size_t type_size, unsigned int elements = 1, bool read = true, bool write = true)
void registerNewAgentVariable(const char *variableName, unsigned int namespace_hash, const char *type, size_t type_size, unsigned int elements = 1, bool read = true, bool write = true)
void unregisterAgentVariable(const char *variableName, unsigned int namespace_hash)
void unregisterMessageOutVariable(const char *variableName, unsigned int namespace_hash)
void unregisterMessageInVariable(const char *variableName, unsigned int namespace_hash)
void unregisterNewAgentVariable(const char *variableName, unsigned int namespace_hash)
void *getAgentVariableCachePtr(const char *variableName)
void *getMessageOutVariableCachePtr(const char *variableName)
void *getMessageInVariableCachePtr(const char *variableName)
void *getNewAgentVariableCachePtr(const char *variableName)
void registerEnvVariable(const char *variableName, unsigned int namespace_hash, ptrdiff_t offset, const char *type, size_t type_size, unsigned int elements = 1)
void unregisterEnvVariable(const char *variableName, unsigned int namespace_hash)
std::string getDynamicHeader()
void updateEnvCache(const char *env_ptr)

Copies EnvironmentManager::MAX_BUFFER_SIZE bytes from env_ptr to h_data_buffer This should be used to copy the EnvironmentManager’s rtc_cache

void updateDevice(const jitify::experimental::KernelInstantiation &instance)

Copy h_data_buffer to device

Public Static Functions

static std::string getVariableSymbolName()
static std::string demangle(const char *verbose_name)

Demangle a verbose type name (e.g. std::type_index.name().c_str()) into a user readable type This is required as different compilers will perform name mangling in different way (or not at all).

static std::string demangle(const std::type_index &type)

Demangle from a std::type_index into a user readable type This is required as different compilers will perform name mangling in different way (or not at all).

Protected Functions

void setHeaderPlaceholder(std::string placeholder, std::string dst)
struct RTCEnvVariableProperties

Public Members

std::string type
unsigned int elements
ptrdiff_t offset
size_t type_size
struct RTCVariableProperties

Public Members

std::string type
bool read
bool write
unsigned int elements
size_t type_size
void *h_data_ptr