MFEM v4.9.0
Finite element discretization library
Loading...
Searching...
No Matches
reducers.hpp File Reference

Go to the source code of this file.

Classes

struct  mfem::DevicePair< A, B >
 Pair of values which can be used in device code. More...
 
struct  mfem::MinMaxLocScalar< A, B >
 Two pairs for the min/max values and their location indices. More...
 
struct  mfem::SumReducer< T >
 a += b More...
 
struct  mfem::MultReducer< T >
 a *= b More...
 
struct  mfem::BAndReducer< T >
 a &= b More...
 
struct  mfem::BOrReducer< T >
 a |= b More...
 
struct  mfem::MinReducer< T >
 a = min(a,b) More...
 
struct  mfem::MinReducer< float >
 
struct  mfem::MinReducer< double >
 
struct  mfem::MaxReducer< T >
 a = max(a,b) More...
 
struct  mfem::MaxReducer< float >
 
struct  mfem::MaxReducer< double >
 
struct  mfem::MinMaxReducer< T >
 a = minmax(a,b) More...
 
struct  mfem::MinMaxReducer< float >
 
struct  mfem::MinMaxReducer< double >
 
struct  mfem::ArgMinReducer< T, I >
 i = argmin(a[i], a[j]) More...
 
struct  mfem::ArgMinReducer< float, I >
 
struct  mfem::ArgMinReducer< double, I >
 
struct  mfem::ArgMaxReducer< T, I >
 i = argmax(a[i], a[j]) More...
 
struct  mfem::ArgMaxReducer< float, I >
 
struct  mfem::ArgMaxReducer< double, I >
 
struct  mfem::ArgMinMaxReducer< T, I >
 
struct  mfem::ArgMinMaxReducer< float, I >
 
struct  mfem::ArgMinMaxReducer< double, I >
 

Namespaces

namespace  mfem
 

Functions

template<class T , class B , class R >
void mfem::reduce (int N, T &res, B &&body, const R &reducer, bool use_dev, Array< T > &workspace)
 Performs a 1D reduction on the range [0,N). res initial value and where the result will be written. body reduction function body. reducer helper for joining two reduced values. use_dev true to perform the reduction on the device, if possible. workspace temporary workspace used for device reductions. May be resized to a larger capacity as needed. Preferably should have MemoryType::MANAGED or MemoryType::HOST_PINNED. TODO: replace with internal temporary workspace vectors once that's added to the memory manager.