Commit 1cbf17d5 authored by Pierre NARVOR's avatar Pierre NARVOR
Browse files

[cuda/functors] Some renaming

parent 44e2175c
......@@ -12,6 +12,8 @@ list(APPEND rtac_cuda_headers
include/rtac_base/cuda/DeviceMesh.h
include/rtac_base/cuda/DeviceObject.h
include/rtac_base/cuda/Texture2D.h
include/rtac_base/cuda/functors.h
include/rtac_base/cuda/FunctorCompound.h
include/rtac_base/cuda/Mapping.h
include/rtac_base/cuda/reductions.hcu
include/rtac_base/cuda/operators.h
......
......@@ -4,7 +4,7 @@
#include <tuple>
#include <rtac_base/cuda/utils.h>
namespace rtac { namespace cuda {
namespace rtac { namespace cuda { namespace functors {
/**
* This class allows for the creation of custom unary Functor types on the fly.
......@@ -83,6 +83,7 @@ struct FunctorCompound
}
};
}; //namespace functors
}; //namespace cuda
}; //namespace rtac
......
......@@ -8,7 +8,7 @@
#include <tuple>
#include <rtac_base/cuda/utils.h>
namespace rtac { namespace cuda { namespace functor {
namespace rtac { namespace cuda { namespace functors {
template <typename Tout, typename Tin = Tout, typename Tscale = Tin>
struct Scaling {
......@@ -35,7 +35,7 @@ struct Offset {
}
};
}; //namespace functor
}; //namespace functors
}; //namespace cuda
}; //namespace rtac
......
......@@ -18,11 +18,11 @@ int main()
//auto output = scaling(input, functor::Scaling<float>({2.0f}));
auto f = Saxpy(functor::Offset<float>({3.0f}), functor::Scaling<float>({2.0f}));
auto f = Saxpy(functors::Offset<float>({3.0f}), functors::Scaling<float>({2.0f}));
cout << f(1.0f) << endl;
auto output = saxpy(input, Saxpy(functor::Offset<float>({3.0f}),
functor::Scaling<float>({2.0f})));
auto output = saxpy(input, Saxpy(functors::Offset<float>({3.0f}),
functors::Scaling<float>({2.0f})));
cout << input << endl;
cout << output << endl;
......
......@@ -4,7 +4,7 @@
namespace rtac { namespace cuda {
DeviceVector<float> scaling(const DeviceVector<float>& input,
const functor::Scaling<float>& func)
const functors::Scaling<float>& func)
{
DeviceVector<float> output(input.size());
......
......@@ -2,15 +2,15 @@
#define _DEF_RTAC_CUDA_TESTS_FUNCTORS_TEST_H_
#include <rtac_base/cuda/DeviceVector.h>
#include <rtac_base/cuda/Functors.h>
#include <rtac_base/cuda/FunctorCompound.h>
#include <rtac_base/cuda/functors.h>
namespace rtac { namespace cuda {
using Saxpy = FunctorCompound<functor::Offset<float>, functor::Scaling<float>>;
using Saxpy = functors::FunctorCompound<functors::Offset<float>, functors::Scaling<float>>;
DeviceVector<float> scaling(const DeviceVector<float>& input,
const functor::Scaling<float>& func);
const functors::Scaling<float>& func);
DeviceVector<float> saxpy(const DeviceVector<float>& input, const Saxpy& func);
}; //namespace cuda
......
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