Mentions légales du service

Skip to content
Snippets Groups Projects
Commit afc8bfe8 authored by Philippe Virouleau's avatar Philippe Virouleau
Browse files

Remove lambdas with parameters inside omp pragmas

Clang seems to be confused by the lambda parameters: it tries to capture it and emit code for it whereas it shouldn't, resulting in an internal error.
parent 7ada633e
Branches
Tags
No related merge requests found
...@@ -333,18 +333,12 @@ public: ...@@ -333,18 +333,12 @@ public:
std::array<multipole_t*, node_t::child_count> child_multipoles {}; std::array<multipole_t*, node_t::child_count> child_multipoles {};
std::transform(std::begin(node->getChildren()), std::end(node->getChildren()), std::transform(std::begin(node->getChildren()), std::end(node->getChildren()),
child_multipoles.begin(), child_multipoles.begin(),
[](node_t* n) { node_t::template getMultipoleDataFromNode<node_t, multipole_t>);
return n == nullptr ? nullptr
: &(n->getData()->getMultipoleData());
});
std::array<symbolic_data_t*, node_t::child_count> child_symbolics {}; std::array<symbolic_data_t*, node_t::child_count> child_symbolics {};
std::transform(std::begin(node->getChildren()), std::end(node->getChildren()), std::transform(std::begin(node->getChildren()), std::end(node->getChildren()),
child_symbolics.begin(), child_symbolics.begin(),
[](node_t* n) { node_t::template getSymbolicData<node_t, symbolic_data_t>);
return n == nullptr ? nullptr
: &(n->getSymbolicData());
});
// Call kernel module // Call kernel module
this->_kernels[thread_num]->M2M( this->_kernels[thread_num]->M2M(
...@@ -863,18 +857,11 @@ public: ...@@ -863,18 +857,11 @@ public:
std::array<local_expansion_t*, node_t::child_count> child_local_expansions {}; std::array<local_expansion_t*, node_t::child_count> child_local_expansions {};
std::transform(std::begin(node->getChildren()), std::end(node->getChildren()), std::transform(std::begin(node->getChildren()), std::end(node->getChildren()),
child_local_expansions.begin(), child_local_expansions.begin(),
[](node_t* n) { node_t::template getLocalExpansionDataFromNode<node_t, local_expansion_t>);
return n == nullptr ? nullptr
: &(n->getData()->getLocalExpansionData());
});
std::array<symbolic_data_t*, node_t::child_count> child_symbolics {}; std::array<symbolic_data_t*, node_t::child_count> child_symbolics {};
std::transform(std::begin(node->getChildren()), std::end(node->getChildren()), std::transform(std::begin(node->getChildren()), std::end(node->getChildren()),
child_symbolics.begin(), child_symbolics.begin(),
[](node_t* n) { node_t::template getSymbolicDataFromNode<node_t, symbolic_data_t>);
return n == nullptr ? nullptr
: &(n->getSymbolicData());
});
this->_kernels[thread_num]->L2L( this->_kernels[thread_num]->L2L(
&(node->getData()->getLocalExpansionData()), &(node->getData()->getLocalExpansionData()),
......
...@@ -983,6 +983,24 @@ private: ...@@ -983,6 +983,24 @@ private:
inria::make_index_sequence<std::tuple_size<Tuple>::value - Dim>{}); inria::make_index_sequence<std::tuple_size<Tuple>::value - Dim>{});
} }
template<typename Node, typename Multipole>
static Multipole *getMultipoleDataFromNode(Node *n) {
return n == nullptr ? nullptr
: &(n->getData()->getMultipoleData());
}
template<typename Node, typename SymbolicData>
static SymbolicData *getSymbolicDataFromNode(Node *n) {
return n == nullptr ? nullptr
: &(n->getSymbolicData());
}
template<typename Node, typename LocalExpansion>
static LocalExpansion *getLocalExpansionDataFromNode(Node *n) {
return n == nullptr ? nullptr
: &(n->getData()->getLocalExpansionData());
}
/** /**
* \brief Reinsert particle in tree after spliting a container * \brief Reinsert particle in tree after spliting a container
* *
......
...@@ -91,6 +91,26 @@ public: ...@@ -91,6 +91,26 @@ public:
/** Do nothing */ /** Do nothing */
void resetToInitialState(){ void resetToInitialState(){
} }
template<typename CellClass, typename Multipole>
static Multipole *getMultipoleDataFromCell(CellClass *c) {
return c == nullptr ? nullptr
: &(c->getMultipoleData());
}
template<typename CellClass, typename LocalExpansion>
static LocalExpansion *getLocalExpansionDataFromCell(CellClass *c) {
return c == nullptr ? nullptr
: &(c->getLocalExpansionData());
}
// FIXME: see Src/Core/FFmmAlgorithmSectionTask.hpp for usage
// This is applied via std::transform to an array of data.
// It doesn't seem to do anything, but I may be missing something.
template<typename CellClass>
static CellClass *noop(CellClass *c) {
return c;
}
}; };
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
#include "../Containers/FOctree.hpp" #include "../Containers/FOctree.hpp"
#include "../Containers/FVector.hpp" #include "../Containers/FVector.hpp"
#include "Components/FBasicCell.hpp"
#include "FCoreCommon.hpp" #include "FCoreCommon.hpp"
#include "FP2PExclusion.hpp" #include "FP2PExclusion.hpp"
...@@ -217,13 +219,10 @@ protected: ...@@ -217,13 +219,10 @@ protected:
CellClass** children = octreeIterator.getCurrentChildren(); CellClass** children = octreeIterator.getCurrentChildren();
std::array<const multipole_t*, 8> child_multipoles; std::array<const multipole_t*, 8> child_multipoles;
std::transform(children, children+8, child_multipoles.begin(), std::transform(children, children+8, child_multipoles.begin(),
[](CellClass* c) { FBasicCell::getMultipoleDataFromCell<const CellClass, const multipole_t>);
return (c == nullptr ? nullptr
: &(c->getMultipoleData()));
});
std::array<const symbolic_data_t*, 8> child_symbolics; std::array<const symbolic_data_t*, 8> child_symbolics;
std::transform(children, children+8, child_symbolics.begin(), std::transform(children, children+8, child_symbolics.begin(),
[](CellClass* c) {return c;}); FBasicCell::noop<const CellClass>);
kernels[omp_get_thread_num()]->M2M(parent_multipole, kernels[omp_get_thread_num()]->M2M(parent_multipole,
parent_symbolic, parent_symbolic,
child_multipoles.data(), child_multipoles.data(),
...@@ -294,13 +293,10 @@ protected: ...@@ -294,13 +293,10 @@ protected:
= octreeIterator.getCurrentCell(); = octreeIterator.getCurrentCell();
std::array<const multipole_t*, 342> neighbor_multipoles; std::array<const multipole_t*, 342> neighbor_multipoles;
std::transform(neighbors, neighbors+counter, neighbor_multipoles.begin(), std::transform(neighbors, neighbors+counter, neighbor_multipoles.begin(),
[](const CellClass* c) { FBasicCell::getMultipoleDataFromCell<const CellClass, const multipole_t>);
return (c == nullptr ? nullptr
: &(c->getMultipoleData()));
});
std::array<const symbolic_data_t*, 342> neighbor_symbolics; std::array<const symbolic_data_t*, 342> neighbor_symbolics;
std::transform(neighbors, neighbors+counter, neighbor_symbolics.begin(), std::transform(neighbors, neighbors+counter, neighbor_symbolics.begin(),
[](const CellClass* c) {return c;}); FBasicCell::noop<const CellClass>);
kernels[omp_get_thread_num()]->M2L( kernels[omp_get_thread_num()]->M2L(
target_local_exp, target_local_exp,
...@@ -365,13 +361,10 @@ protected: ...@@ -365,13 +361,10 @@ protected:
= octreeIterator.getCurrentCell(); = octreeIterator.getCurrentCell();
std::array<const multipole_t*, 342> neighbor_multipoles; std::array<const multipole_t*, 342> neighbor_multipoles;
std::transform(neighbors, neighbors+counter, neighbor_multipoles.begin(), std::transform(neighbors, neighbors+counter, neighbor_multipoles.begin(),
[](const CellClass* c) { FBasicCell::getMultipoleDataFromCell<const CellClass, const multipole_t>);
return (c == nullptr ? nullptr
: &(c->getMultipoleData()));
});
std::array<const symbolic_data_t*, 342> neighbor_symbolics; std::array<const symbolic_data_t*, 342> neighbor_symbolics;
std::transform(neighbors, neighbors+counter, neighbor_symbolics.begin(), std::transform(neighbors, neighbors+counter, neighbor_symbolics.begin(),
[](const CellClass* c) {return c;}); FBasicCell::noop<const CellClass>);
kernels[omp_get_thread_num()]->M2L( kernels[omp_get_thread_num()]->M2L(
target_local_exp, target_local_exp,
...@@ -427,12 +420,10 @@ protected: ...@@ -427,12 +420,10 @@ protected:
CellClass** children = octreeIterator.getCurrentChildren(); CellClass** children = octreeIterator.getCurrentChildren();
std::array<local_expansion_t*, 8> child_local_expansions; std::array<local_expansion_t*, 8> child_local_expansions;
std::transform(children, children+8, child_local_expansions.begin(), std::transform(children, children+8, child_local_expansions.begin(),
[](CellClass* c) {return (c == nullptr ? nullptr FBasicCell::getLocalExpansionDataFromCell<CellClass, local_expansion_t>);
: &(c->getLocalExpansionData()));
});
std::array<symbolic_data_t*, 8> child_symbolics; std::array<symbolic_data_t*, 8> child_symbolics;
std::transform(children, children+8, child_symbolics.begin(), std::transform(children, children+8, child_symbolics.begin(),
[](CellClass* c) {return c;}); FBasicCell::noop<CellClass>);
kernels[omp_get_thread_num()]->L2L( kernels[omp_get_thread_num()]->L2L(
parent_local_exp, parent_local_exp,
parent_symbolic, parent_symbolic,
......
...@@ -7,18 +7,18 @@ ...@@ -7,18 +7,18 @@
#include <omp.h> #include <omp.h>
#include "../Utils/FGlobal.hpp"
#include "../Utils/FAssert.hpp"
#include "Utils/FLog.hpp"
#include "Utils/FEnv.hpp"
#include "Utils/FAlgorithmTimers.hpp" #include "Utils/FAlgorithmTimers.hpp"
#include "Utils/FAssert.hpp"
#include "Utils/FEnv.hpp"
#include "Utils/FGlobal.hpp"
#include "Utils/FLog.hpp"
#include "Utils/FTic.hpp" #include "Utils/FTic.hpp"
#include "Utils/FAlgorithmTimers.hpp"
#include "Containers/FOctree.hpp" #include "Containers/FOctree.hpp"
#include "Containers/FVector.hpp" #include "Containers/FVector.hpp"
#include "Components/FBasicCell.hpp"
#include "FCoreCommon.hpp" #include "FCoreCommon.hpp"
#include "FP2PExclusion.hpp" #include "FP2PExclusion.hpp"
...@@ -374,13 +374,10 @@ protected: ...@@ -374,13 +374,10 @@ protected:
= octreeIterator.getCurrentCell(); = octreeIterator.getCurrentCell();
std::array<const multipole_t*, 342> neighbor_multipoles; std::array<const multipole_t*, 342> neighbor_multipoles;
std::transform(neighbors, neighbors+counter, neighbor_multipoles.begin(), std::transform(neighbors, neighbors+counter, neighbor_multipoles.begin(),
[](const CellClass* c) { FBasicCell::getMultipoleDataFromCell<const CellClass, const multipole_t>);
return (c == nullptr ? nullptr
: &(c->getMultipoleData()));
});
std::array<const symbolic_data_t*, 342> neighbor_symbolics; std::array<const symbolic_data_t*, 342> neighbor_symbolics;
std::transform(neighbors, neighbors+counter, neighbor_symbolics.begin(), std::transform(neighbors, neighbors+counter, neighbor_symbolics.begin(),
[](const CellClass* c) {return c;}); FBasicCell::noop<const CellClass>);
kernels[omp_get_thread_num()]->M2L( kernels[omp_get_thread_num()]->M2L(
target_local_exp, target_local_exp,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment