Google Test Unit Tests for the kernels associated with the Random Ball Cover
data structure.
More...
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <numeric>
#include <chrono>
#include <random>
#include <limits>
#include <cmath>
#include <gtest/gtest.h>
#include <CLUtils.hpp>
#include <RBC/algorithms.hpp>
#include <RBC/tests/helper_funcs.hpp>
|
void | fread (const char *path, char *data, size_t n) |
| Reads in a binary file. More...
|
|
unsigned int | clean_data (std::vector< cl_float4 >::iterator dBegin, std::vector< cl_float4 >::iterator dEnd, std::vector< cl_float4 >::iterator cBegin, std::vector< cl_float4 >::iterator cEnd) |
| Finds the invalid points (zero coordinates) and pushes them to the end of the sequences. More...
|
|
template<typename iterator > |
void | random_unique (iterator cBegin, iterator dBegin, iterator rcBegin, iterator rdBegin, size_t n, size_t rn) |
| Picks a number of elements uniformly at random without replacement from the input sequences. More...
|
|
| TEST (RBC, rbcRGBD) |
| Tests the RBCSearch class on an 8-D point cloud. More...
|
|
int | main (int argc, char **argv) |
|
Google Test Unit Tests for the kernels associated with the Random Ball Cover
data structure.
- Note
- Use the
--profiling
flag to enable profiling of the kernels.
-
The benchmarks in these tests are against naive CPU implementations of the associated algorithms. They are used only for testing purposes, and not for examining the performance of their GPU alternatives.
- Author
- Nick Lamprianidis
- Version
- 1.2.1
- Date
- 2015
- Copyright
- The MIT License (MIT)
- Copyright (c) 2015 Nick Lamprianidis
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
unsigned int clean_data |
( |
std::vector< cl_float4 >::iterator |
dBegin, |
|
|
std::vector< cl_float4 >::iterator |
dEnd, |
|
|
std::vector< cl_float4 >::iterator |
cBegin, |
|
|
std::vector< cl_float4 >::iterator |
cEnd |
|
) |
| |
Finds the invalid points (zero coordinates) and pushes them to the end of the sequences.
- Parameters
-
[in] | dBegin | input iterator to the initial position of the sequence with the pc4d data. |
[in] | dEnd | input iterator past the last position of the sequence with the pc4d data. |
[in] | cBegin | input iterator to the initial position of the sequence with the rgba data. |
[in] | cEnd | input iterator past the last position of the sequence with the rgba data. |
- Returns
- The number of invalid points.
void fread |
( |
const char * |
path, |
|
|
char * |
data, |
|
|
size_t |
n |
|
) |
| |
Reads in a binary file.
- Parameters
-
[in] | path | path to the file. |
[out] | data | array that receives the data. |
[in] | n | number of bytes to read. |
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
template<typename iterator >
void random_unique |
( |
iterator |
cBegin, |
|
|
iterator |
dBegin, |
|
|
iterator |
rcBegin, |
|
|
iterator |
rdBegin, |
|
|
size_t |
n, |
|
|
size_t |
rn |
|
) |
| |
Picks a number of elements uniformly at random without replacement from the input sequences.
The function implements a Fisher-Yates shuffle.
- Parameters
-
[in] | cBegin | input iterator to the initial position of the sequence with the rgba/pc4d data. |
[in] | dBegin | input iterator to the initial position of the sequence with the pc4d/rgba data. |
[out] | rcBegin | output iterator to the initial position of the sequence with the chosen rgba/pc4d data. |
[out] | rdBegin | output iterator to the initial position of the sequence with the chosen pc4d/rgba data. |
[in] | n | number of points in the input sequences. |
[in] | rn | number of points in the output sequences. |
Tests the RBCSearch class on an 8-D point cloud.
The class computes the NNs of a set of queries.
const std::vector<std::string> kernel_files |
Initial value:= { "kernels/rbc_kernels.cl",
"kernels/scan_kernels.cl",
"kernels/reduce_kernels.cl" }