From e36b9bc6fdb888baeeca43617de15efa000e4cac Mon Sep 17 00:00:00 2001 From: Christian Zimmermann Date: Tue, 15 Oct 2024 10:51:23 -0700 Subject: [PATCH] mpi: WIP: add rank acc xpr --- src/opt/mpi/include/racc_xpr.cc.h | 46 +++++++++++++++++++++++++++++++ src/opt/mpi/include/racc_xpr.h | 45 ++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 src/opt/mpi/include/racc_xpr.cc.h create mode 100644 src/opt/mpi/include/racc_xpr.h diff --git a/src/opt/mpi/include/racc_xpr.cc.h b/src/opt/mpi/include/racc_xpr.cc.h new file mode 100644 index 0000000..5ed1b31 --- /dev/null +++ b/src/opt/mpi/include/racc_xpr.cc.h @@ -0,0 +1,46 @@ + +#ifndef __cxz_mpi_racc_xpr_cc_h__ +#define __cxz_mpi_racc_xpr_cc_h__ + +#include "racc_xpr.h" + +namespace CNOXRZ +{ + namespace mpi + { + template + constexpr RankAccXpr::RankAccXpr(SizeT size, const IndexId& id, + const Xpr& xpr, F&& f) : + + {} + + template + template + inline decltype(auto) RankAccXpr::operator()(const PosT& last) const + { + + } + + template + inline decltype(auto) RankAccXpr::operator()() const + { + + } + + template + template + inline decltype(auto) RankAccXpr::rootSteps(const IndexId& id) const + { + + } + + template + constexpr decltype(auto) rankaccxpr(SizeT size, const IndexId& id, + const Xpr& xpr, F&& f) + { + return RankAccXpr(size, id, xpr, std::forward(f)); + } + } +} + +#endif diff --git a/src/opt/mpi/include/racc_xpr.h b/src/opt/mpi/include/racc_xpr.h new file mode 100644 index 0000000..23b84fd --- /dev/null +++ b/src/opt/mpi/include/racc_xpr.h @@ -0,0 +1,45 @@ + +// rank access expression, fix rank position to current rank + +#ifndef __cxz_mpi_racc_xpr_h__ +#define __cxz_mpi_racc_xpr_h__ + +#include "mpi_base.h" + +namespace CNORXZ +{ + namespace mpi + { + + template + class RankAccXpr : public XprInterface> + { + public: + DEFAULT_MEMBERS(RankAccXpr); + + constexpr RankAccXpr(SizeT size, const IndexId& id, const Xpr& xpr, F&& f); + + template + inline decltype(auto) operator()(const PosT& last) const; + + inline decltype(auto) operator()() const; + + template + inline decltype(auto) rootSteps(const IndexId& id) const; + + private: + SizeT mSize = 0; + IndexId mId; + Xpr mXpr; + typedef decltype(mXpr.rootSteps(mId)) XPosT; + XPosT mExt; + F mF; + }; + + template + constexpr decltype(auto) rankaccxpr(SizeT size, const IndexId& id, + const Xpr& xpr, F&& f); + } +} + +#endif