IPPL API Reference
Independent Parallel Particle Layer C++ API
Loading...
Searching...
No Matches
IpplOperations.h File Reference
#include <Kokkos_MathematicalFunctions.hpp>
#include <tuple>
+ Include dependency graph for IpplOperations.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ippl::ExtractExpressionRank
 
struct  ippl::detail::meta_cross< E1, E2 >
 

Namespaces

namespace  ippl
 

Macros

#define DefineUnaryOperation(fun, name, op1, op2)
 
#define DefineBinaryOperation(fun, name, op1, op2)
 

Functions

template<typename View , typename Coords , size_t... Idx>
KOKKOS_INLINE_FUNCTION constexpr decltype(auto) ippl::apply_impl (const View &view, const Coords &coords, const std::index_sequence< Idx... > &)
 
template<typename View , typename Coords >
KOKKOS_INLINE_FUNCTION constexpr decltype(auto) ippl::apply (const View &view, const Coords &coords)
 
template<typename E1 , size_t N1, typename E2 , size_t N2>
KOKKOS_INLINE_FUNCTION detail::meta_cross< E1, E2 > ippl::cross (const detail::Expression< E1, N1 > &u, const detail::Expression< E2, N2 > &v)
 
template<typename E1 , size_t N1, typename E2 , size_t N2>
KOKKOS_INLINE_FUNCTION detail::meta_dot< E1, E2 > ippl::dot (const detail::Expression< E1, N1 > &u, const detail::Expression< E2, N2 > &v)
 

Macro Definition Documentation

◆ DefineBinaryOperation

#define DefineBinaryOperation (   fun,
  name,
  op1,
  op2 
)

Macro to overload C++ operators for the Scalar, BareField and Vector class.

Parameters
funname of the expression template function
nameoverloaded operator
op1operation for single index access
op2operation for multiple indices access

◆ DefineUnaryOperation

#define DefineUnaryOperation (   fun,
  name,
  op1,
  op2 
)
Value:
template <typename E> \
struct fun : public detail::Expression<fun<E>, sizeof(E)> { \
constexpr static unsigned dim = E::dim; \
using value_type = typename E::value_type; \
\
KOKKOS_FUNCTION \
fun(const E& u) \
: u_m(u) {} \
\
KOKKOS_INLINE_FUNCTION auto operator[](size_t i) const { return op1; } \
\
template <typename... Args> \
KOKKOS_INLINE_FUNCTION auto operator()(Args... args) const { \
return op2; \
} \
\
private: \
const E u_m; \
}; \
\
template <typename E, size_t N> \
KOKKOS_INLINE_FUNCTION fun<E> name(const detail::Expression<E, N>& u) { \
return fun<E>(*static_cast<const E*>(&u)); \
}