Template Function flamegpu::agent_function_wrapper
Defined in File AgentFunction.cuh
Function Documentation
-
template<typename AgentFunction, typename MessageIn, typename MessageOut>
__global__ void flamegpu::agent_function_wrapper(exception::DeviceExceptionBuffer *error_buffer, const detail::curve::CurveTable *__restrict__ d_curve_table, const char *d_agent_name, const char *d_state_name, const char *d_env_buffer, id_t *d_agent_output_nextID, const unsigned int popNo, const void *in_messagelist_metadata, const void *out_messagelist_metadata, detail::curandState *d_rng, unsigned int *scanFlag_agentDeath, unsigned int *scanFlag_messageOutput, unsigned int *scanFlag_agentOutput) Wrapper function for launching agent functions Initialises FLAMEGPU_API instance
- Parameters:
error_buffer – Buffer used for detecting and reporting exception::DeviceErrors (flamegpu must be built with FLAMEGPU_SEATBELTS enabled for this to be used)
d_curve_table – Pointer to curve hash table in device memory
d_agent_name – Pointer to agent name string
d_state_name – Pointer to agent state string
d_env_buffer – Pointer to env buffer in device memory
d_agent_output_nextID – If agent output is enabled, this points to a global memory src of the next suitable agent id, this will be atomically incremented at birth
popNo – Total number of agents executing the function (number of threads launched)
in_messagelist_metadata – Pointer to the MessageIn metadata struct, it is interpreted by MessageIn
out_messagelist_metadata – Pointer to the MessageOut metadata struct, it is interpreted by MessageOut
d_rng – Array of curand states for this kernel
scanFlag_agentDeath – Scanflag array for agent death
scanFlag_messageOutput – Scanflag array for optional message output
scanFlag_agentOutput – Scanflag array for optional agent output
- Template Parameters:
AgentFunction – The modeller defined agent function (defined as FLAMEGPU_AGENT_FUNCTION in model code)
MessageIn – Message handler for input messages (e.g. MessageNone, MessageBruteForce, MessageSpatial3D)
MessageOut – Message handler for output messages (e.g. MessageNone, MessageBruteForce, MessageSpatial3D)