|
KaMPIng 0.2.1
(Near) zero-overhead MPI wrapper for C++
|
RAII handle that creates an MPI_Op from a default-constructible C++ functor.
More...
#include <reduce_ops.hpp>
Public Member Functions | |
| ScopedFunctorOp (Op op) | |
Creates an MPI_Op for the given functor. | |
| ScopedFunctorOp (ScopedFunctorOp const &)=delete | |
| ScopedFunctorOp & | operator= (ScopedFunctorOp const &)=delete |
| ScopedFunctorOp (ScopedFunctorOp &&)=delete | |
| ScopedFunctorOp & | operator= (ScopedFunctorOp &&)=delete |
| MPI_Op | get () const noexcept |
| T | operator() (T const &lhs, T const &rhs) const |
| Applies the functor to two values. | |
RAII handle that creates an MPI_Op from a default-constructible C++ functor.
Calls MPI_Op_create on construction and MPI_Op_free on destruction. The functor is invoked via MPI_Op_create's callback and must be default-constructible (i.e. stateless or state carried via static variables). For capturing lambdas use ScopedCallbackOp.
| is_commutative | Whether the operation is commutative. |
| T | Element type the functor operates on. |
| Op | Functor type. Must be default-constructible and callable as T(T const&, T const&). |
|
inlinenoexcept |
MPI_Op. Do not free manually — the destructor does it.