Commit 30317864 authored by Quentin Khan's avatar Quentin Khan

PerfTest/Descriptors: follow-up to 1689d3f8 - use same constructor for all algorithms

parent 62621b53
......@@ -56,9 +56,9 @@ private:
public:
FAdaptiveSequential(tree_t& tree, kernel_t& kernel) :
_tree(tree),
_kernel(kernel) {
FAdaptiveSequential(tree_t* tree, kernel_t* kernel) :
_tree(*tree),
_kernel(*kernel) {
}
std::string name() const override {
......
......@@ -147,8 +147,8 @@ public:
* \param tree The tree to run over
* \param kernel The kernel to use
*/
FAdaptiveTask(tree_t& tree, kernel_t& kernel) :
_tree(tree)
FAdaptiveTask(tree_t* tree, kernel_t* kernel) :
_tree(*tree)
{
// Place kernel objects near their threads in memory to avoid NUMA
// latency
......@@ -156,7 +156,7 @@ public:
{
for(int i = 0; i < omp_get_num_threads(); ++i) {
if(i == omp_get_thread_num()) {
this->_kernels.emplace_back(new kernel_t(kernel));
this->_kernels.emplace_back(new kernel_t(*kernel));
}
#pragma omp barrier
}
......
......@@ -120,7 +120,6 @@ struct algo_descriptor {
*/
template<typename FReal>
struct kernel_descriptor<FReal, 0> {
enum : bool {disabled = true};
/// Kernel lookup name
constexpr static const char* name = "lagrange";
/// Interpolation order
......@@ -407,7 +406,7 @@ template<typename FReal> struct algo_descriptor<FReal, 0> {
template<typename tree_t, typename kernel_t>
std::unique_ptr<algo_t<tree_t, kernel_t> >
build(const FPerfTestParams&, tree_t& tree, kernel_t& kernel) {
return std::make_unique<algo_t<tree_t, kernel_t> >(tree, kernel);
return std::make_unique<algo_t<tree_t, kernel_t> >(&tree, &kernel);
}
};
};
......@@ -432,7 +431,7 @@ template<typename FReal> struct algo_descriptor<FReal, 1> {
template<typename tree_t, typename kernel_t>
std::unique_ptr<algo_t<tree_t, kernel_t> >
build(const FPerfTestParams&, tree_t& tree, kernel_t& kernel) {
return std::make_unique<algo_t<tree_t, kernel_t> >(tree, kernel);
return std::make_unique<algo_t<tree_t, kernel_t> >(&tree, &kernel);
}
};
};
......@@ -600,7 +599,7 @@ template<typename FReal> struct algo_descriptor<FReal, 7> {
template<typename tree_t, typename kernel_t>
std::unique_ptr<algo_t<tree_t, kernel_t> >
build(const FPerfTestParams&, tree_t& tree, kernel_t& kernel) {
return std::make_unique<algo_t<tree_t, kernel_t> >(tree, kernel);
return std::make_unique<algo_t<tree_t, kernel_t> >(&tree, &kernel);
}
};
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment