Point Cloud Library (PCL)
1.15.1
Toggle main menu visibility
Loading...
Searching...
No Matches
utils
include
pcl
gpu
utils
device
functional.hpp
1
/*
2
* Software License Agreement (BSD License)
3
*
4
* Copyright (c) 2011, Willow Garage, Inc.
5
* All rights reserved.
6
*
7
* Redistribution and use in source and binary forms, with or without
8
* modification, are permitted provided that the following conditions
9
* are met:
10
*
11
* * Redistributions of source code must retain the above copyright
12
* notice, this list of conditions and the following disclaimer.
13
* * Redistributions in binary form must reproduce the above
14
* copyright notice, this list of conditions and the following
15
* disclaimer in the documentation and/or other materials provided
16
* with the distribution.
17
* * Neither the name of Willow Garage, Inc. nor the names of its
18
* contributors may be used to endorse or promote products derived
19
* from this software without specific prior written permission.
20
*
21
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
* POSSIBILITY OF SUCH DAMAGE.
33
*
34
* Author: Anatoly Baskeheev, Itseez Ltd, (myname.mysurname@mycompany.com)
35
*/
36
37
38
#ifndef PCL_DEVICE_FUNCTIONAL_HPP_
39
#define PCL_DEVICE_FUNCTIONAL_HPP_
40
41
#include <thrust/functional.h>
42
#include <cuda.h>
43
44
namespace
pcl
45
{
46
namespace
device
47
{
48
49
// Arithmetic Operations
50
51
using
thrust::plus;
52
using
thrust::minus;
53
using
thrust::multiplies;
54
using
thrust::divides;
55
using
thrust::modulus;
56
using
thrust::negate;
57
58
// Comparison Operations
59
60
using
thrust::equal_to;
61
using
thrust::not_equal_to;
62
using
thrust::greater;
63
using
thrust::less;
64
using
thrust::greater_equal;
65
using
thrust::less_equal;
66
67
// Logical Operations
68
69
using
thrust::logical_and;
70
using
thrust::logical_or;
71
using
thrust::logical_not;
72
73
// Bitwise Operations
74
75
using
thrust::bit_and;
76
using
thrust::bit_or;
77
using
thrust::bit_xor;
78
79
template
<
typename
T>
struct
bit_not
80
{
81
typedef
T
argument_type
;
82
typedef
T
result_type
;
83
__forceinline__ __device__ T
operator ()
(
const
T& v)
const
{
return
~v;}
84
};
85
86
// Generalized Identity Operations
87
88
#if CUDA_VERSION >= 13000
89
using
cuda::std::identity;
90
#else
91
using
thrust::identity;
92
#endif
93
using
thrust::project1st;
94
using
thrust::project2nd;
95
96
97
// Other functors
98
99
template
<
typename
T,
typename
W>
100
struct
plusWeighted
:
public
plus<T>
101
{
102
W
w
;
103
__device__ __host__ __forceinline__
plusWeighted
(W weight) :
w
(weight) {}
104
__device__ __host__ __forceinline__
float
operator()
(
const
T& f1,
const
T& f2)
const
105
{
106
return
f1 + f2 *
w
;
107
}
108
};
109
}
110
};
111
112
113
#endif
/* PCL_DEVICE_FUNCTIONAL_HPP_ */
pcl::device
Definition
device_array.h:315
pcl
Definition
convolution.h:46
pcl::device::bit_not
Definition
functional.hpp:80
pcl::device::bit_not::argument_type
T argument_type
Definition
functional.hpp:81
pcl::device::bit_not::operator()
__forceinline__ __device__ T operator()(const T &v) const
Definition
functional.hpp:83
pcl::device::bit_not::result_type
T result_type
Definition
functional.hpp:82
pcl::device::plusWeighted::operator()
__device__ __host__ __forceinline__ float operator()(const T &f1, const T &f2) const
Definition
functional.hpp:104
pcl::device::plusWeighted::plusWeighted
__device__ __host__ __forceinline__ plusWeighted(W weight)
Definition
functional.hpp:103
pcl::device::plusWeighted::w
W w
Definition
functional.hpp:102