OpenLB 1.7
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
olb::gpu::cuda::maximum_and_plus< T > Struct Template Reference

Function object for simulateneously computing maximum and sum in a single thrust::reduce. More...

#include <statistics.hh>

+ Collaboration diagram for olb::gpu::cuda::maximum_and_plus< T >:

Public Types

using first_argument_type = pair<T,T>
 
using second_argument_type = pair<T,T>
 
using result_type = pair<T,T>
 

Public Member Functions

__device__ result_type operator() (const first_argument_type &lhs, const second_argument_type &rhs) const
 

Detailed Description

template<typename T>
struct olb::gpu::cuda::maximum_and_plus< T >

Function object for simulateneously computing maximum and sum in a single thrust::reduce.

Definition at line 63 of file statistics.hh.

Member Typedef Documentation

◆ first_argument_type

template<typename T >
using olb::gpu::cuda::maximum_and_plus< T >::first_argument_type = pair<T,T>

Definition at line 64 of file statistics.hh.

◆ result_type

template<typename T >
using olb::gpu::cuda::maximum_and_plus< T >::result_type = pair<T,T>

Definition at line 66 of file statistics.hh.

◆ second_argument_type

template<typename T >
using olb::gpu::cuda::maximum_and_plus< T >::second_argument_type = pair<T,T>

Definition at line 65 of file statistics.hh.

Member Function Documentation

◆ operator()()

template<typename T >
__device__ result_type olb::gpu::cuda::maximum_and_plus< T >::operator() ( const first_argument_type & lhs,
const second_argument_type & rhs ) const
inline

Definition at line 68 of file statistics.hh.

69 {
70 return {lhs.first < rhs.first ? rhs.first : lhs.first,
71 lhs.second + rhs.second};
72 }

References olb::gpu::cuda::pair< T, U >::first, and olb::gpu::cuda::pair< T, U >::second.


The documentation for this struct was generated from the following file: