Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Pierre NARVOR
rtac_base
Commits
1cbf17d5
Commit
1cbf17d5
authored
Oct 27, 2021
by
Pierre NARVOR
Browse files
[cuda/functors] Some renaming
parent
44e2175c
Changes
6
Hide whitespace changes
Inline
Side-by-side
cuda/CMakeLists.txt
View file @
1cbf17d5
...
...
@@ -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
...
...
cuda/include/rtac_base/cuda/Functor
s
.h
→
cuda/include/rtac_base/cuda/Functor
Compound
.h
View file @
1cbf17d5
...
...
@@ -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
...
...
cuda/include/rtac_base/cuda/functors.h
View file @
1cbf17d5
...
...
@@ -8,7 +8,7 @@
#include <tuple>
#include <rtac_base/cuda/utils.h>
namespace
rtac
{
namespace
cuda
{
namespace
functor
{
namespace
rtac
{
namespace
cuda
{
namespace
functor
s
{
template
<
typename
Tout
,
typename
Tin
=
Tout
,
typename
Tscale
=
Tin
>
struct
Scaling
{
...
...
@@ -35,7 +35,7 @@ struct Offset {
}
};
};
//namespace functor
};
//namespace functor
s
};
//namespace cuda
};
//namespace rtac
...
...
cuda/tests/functors/src/functors_test.cpp
View file @
1cbf17d5
...
...
@@ -18,11 +18,11 @@ int main()
//auto output = scaling(input, functor::Scaling<float>({2.0f}));
auto
f
=
Saxpy
(
functor
::
Offset
<
float
>
({
3.0
f
}),
functor
::
Scaling
<
float
>
({
2.0
f
}));
auto
f
=
Saxpy
(
functor
s
::
Offset
<
float
>
({
3.0
f
}),
functor
s
::
Scaling
<
float
>
({
2.0
f
}));
cout
<<
f
(
1.0
f
)
<<
endl
;
auto
output
=
saxpy
(
input
,
Saxpy
(
functor
::
Offset
<
float
>
({
3.0
f
}),
functor
::
Scaling
<
float
>
({
2.0
f
})));
auto
output
=
saxpy
(
input
,
Saxpy
(
functor
s
::
Offset
<
float
>
({
3.0
f
}),
functor
s
::
Scaling
<
float
>
({
2.0
f
})));
cout
<<
input
<<
endl
;
cout
<<
output
<<
endl
;
...
...
cuda/tests/functors/src/functors_test.cu
View file @
1cbf17d5
...
...
@@ -4,7 +4,7 @@
namespace
rtac
{
namespace
cuda
{
DeviceVector
<
float
>
scaling
(
const
DeviceVector
<
float
>&
input
,
const
functor
::
Scaling
<
float
>&
func
)
const
functor
s
::
Scaling
<
float
>&
func
)
{
DeviceVector
<
float
>
output
(
input
.
size
());
...
...
cuda/tests/functors/src/functors_test.h
View file @
1cbf17d5
...
...
@@ -2,15 +2,15 @@
#define _DEF_RTAC_CUDA_TESTS_FUNCTORS_TEST_H_
#include <rtac_base/cuda/DeviceVector.h>
#include <rtac_base/cuda/Functor
s
.h>
#include <rtac_base/cuda/Functor
Compound
.h>
#include <rtac_base/cuda/functors.h>
namespace
rtac
{
namespace
cuda
{
using
Saxpy
=
FunctorCompound
<
functor
::
Offset
<
float
>
,
functor
::
Scaling
<
float
>>
;
using
Saxpy
=
functors
::
FunctorCompound
<
functor
s
::
Offset
<
float
>
,
functor
s
::
Scaling
<
float
>>
;
DeviceVector
<
float
>
scaling
(
const
DeviceVector
<
float
>&
input
,
const
functor
::
Scaling
<
float
>&
func
);
const
functor
s
::
Scaling
<
float
>&
func
);
DeviceVector
<
float
>
saxpy
(
const
DeviceVector
<
float
>&
input
,
const
Saxpy
&
func
);
};
//namespace cuda
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment