Class ReadOnlyDeviceAPI

Class Documentation

class ReadOnlyDeviceAPI

FLAMEGPU_API is a singleton class for the device runtime.

Todo:

longer description

Public Functions

__device__ inline ReadOnlyDeviceAPI(const Curve::NamespaceHash &instance_id_hash, const Curve::NamespaceHash &agentfuncname_hash, curandState *&d_rng)
Parameters
  • instance_id_hash – CURVE hash of the CUDASimulation’s instance id

  • modelname_hash – CURVE hash of the model’s name

template<typename T, unsigned int N>
__device__ T getVariable(const char (&variable_name)[N])

Gets an agent memory value.

Parameters

variable_name – Name of memory variable to retrieve

template<typename T, unsigned int N, unsigned int M>
__device__ T getVariable(const char (&variable_name)[M], const unsigned int &index)

Gets an agent memory value.

Parameters

variable_name – Name of memory variable to retrieve

__forceinline__ __device__ inline unsigned int getStepCounter() const

Access the current stepCount

Returns

the current step count, 0 indexed unsigned.

Public Members

const AgentRandom random

Provides access to random functionality inside agent functions

Note

random state isn’t stored within the object, so it can be const

const DeviceEnvironment environment

Provides access to environment variables inside agent functions

Protected Attributes

Curve::NamespaceHash agent_func_name_hash

Protected Static Functions

static inline __forceinline__ static __device__ unsigned int TID ()

Thread index