.. _program_listing_file_include_flamegpu_simulation_AgentLoggingConfig_Reductions.cuh: Program Listing for File AgentLoggingConfig_Reductions.cuh ========================================================== |exhale_lsh| :ref:`Return to documentation for file ` (``include/flamegpu/simulation/AgentLoggingConfig_Reductions.cuh``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #ifndef INCLUDE_FLAMEGPU_SIMULATION_AGENTLOGGINGCONFIG_REDUCTIONS_CUH_ #define INCLUDE_FLAMEGPU_SIMULATION_AGENTLOGGINGCONFIG_REDUCTIONS_CUH_ namespace flamegpu { namespace detail { struct standard_deviation_add_impl { public: template struct binary_function { __device__ __forceinline__ OutT operator()(const OutT &a, const OutT &b) const; }; }; struct standard_deviation_subtract_mean_impl { public: template struct unary_function { __host__ __device__ OutT operator()(const InT &a) const; }; }; extern __constant__ double STANDARD_DEVIATION_MEAN; extern std::mutex STANDARD_DEVIATION_MEAN_mutex; extern standard_deviation_add_impl standard_deviation_add; extern standard_deviation_subtract_mean_impl standard_deviation_subtract_mean; template __device__ __forceinline__ OutT standard_deviation_add_impl::binary_function::operator()(const OutT & a, const OutT & b) const { return a + b; } template __device__ __forceinline__ OutT standard_deviation_subtract_mean_impl::unary_function::operator()(const InT &a) const { return pow(a - detail::STANDARD_DEVIATION_MEAN, 2.0); } } // namespace detail } // namespace flamegpu #endif // INCLUDE_FLAMEGPU_SIMULATION_AGENTLOGGINGCONFIG_REDUCTIONS_CUH_