Template Function flamegpu::agent_function_wrapper

Function Documentation

template<typename AgentFunction, typename MessageIn, typename MessageOut>
__global__ void flamegpu::agent_function_wrapper(exception::DeviceExceptionBuffer *error_buffer, detail::curve::Curve::NamespaceHash instance_id_hash, detail::curve::Curve::NamespaceHash agent_func_name_hash, detail::curve::Curve::NamespaceHash messagename_inp_hash, detail::curve::Curve::NamespaceHash messagename_outp_hash, detail::curve::Curve::NamespaceHash agent_output_hash, id_t *d_agent_output_nextID, const unsigned int popNo, const void *in_messagelist_metadata, const void *out_messagelist_metadata, 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 SEATBELTS enabled for this to be used)

  • instance_id_hash – CURVE hash of the CUDASimulation’s instance id

  • agent_func_name_hash – CURVE hash of the agent + function’s names

  • messagename_inp_hash – CURVE hash of the input message’s name

  • messagename_outp_hash – CURVE hash of the output message’s name

  • agent_output_hash – CURVE hash of “_agent_birth” or 0 if agent birth not present

  • 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