Declarations of helper functions for testing. More...
#include <cassert>
#include <algorithm>
#include <functional>
#include <RBC/data_types.hpp>
#include <CL/cl.hpp>
Go to the source code of this file.
Namespaces | |
RBC | |
Functions | |
bool | RBC::setProfilingFlag (int argc, char **argv) |
Checks the command line arguments for the profiling flag, --profiling . More... | |
template<typename T > | |
uint64_t | RBC::nextPow2 (T num) |
Returns the first power of 2 greater than or equal to the input. More... | |
template<typename T > | |
void | RBC::printBuffer (const char *title, T *ptr, uint32_t width, uint32_t height) |
Prints an array of an integer type to standard output. More... | |
template<typename T > | |
void | RBC::printBufferF (const char *title, T *ptr, uint32_t width, uint32_t height, uint32_t prec) |
Prints an array of floating-point type to standard output. More... | |
template<typename T > | |
void | RBC::cpuReduce (T *in, T *out, uint32_t cols, uint32_t rows, std::function< bool(T, T)> func) |
Reduces each row of an array to a single element. More... | |
template<typename T > | |
void | RBC::cpuInScan (T *in, T *out, uint32_t width, uint32_t height) |
Performs an inclusive scan operation on the columns of an array. More... | |
template<typename T > | |
void | RBC::cpuExScan (T *in, T *out, uint32_t width, uint32_t height) |
Performs an exclusive scan operation on the columns of an array. More... | |
template<typename T > | |
void | RBC::cpuRBCComputeDists (T *X, T *R, T *D, uint32_t nx, uint32_t nr, uint32_t d) |
Computes the distances between two sets of points in a brute force way. More... | |
template<typename T > | |
void | RBC::cpuRBCComputeDists8 (T *X, T *R, T *D, uint32_t nx, uint32_t nr, uint32_t d, T a) |
Computes the distances between two sets of points in a brute force way. More... | |
template<typename T > | |
void | RBC::cpuRBCMinDists (T *in, rbc_dist_id *out, uint32_t *N, uint32_t *Rnk, uint32_t cols, uint32_t rows, bool accCounters) |
Computes the minimum element, and its corresponding column id, for each row in an array. It also builds a histogram of the id values. And lastly, it stores the rank (order of insert) of each minimum element within its corresponding histogram bin. More... | |
template<typename T > | |
void | RBC::cpuRBCPermute (T *X, rbc_dist_id *ID, T *Xp, rbc_dist_id *IDp, uint32_t *O, uint32_t *Rnk, uint32_t nx, uint32_t nr, uint32_t d, bool permID) |
Performs a permutation of the RBC database to form the representative lists. More... | |
template<typename T > | |
T | RBC::euclideanMetric (T *p1, T *p2, uint32_t d) |
Calculates the euclidean distance betweeen two points. More... | |
template<typename T > | |
T | RBC::euclideanMetric8Squared (T *p1, T *p2, float a) |
Calculates the euclidean distance betweeen two points in \( \mathbb{R}^8 \).. More... | |
template<typename T > | |
void | RBC::cpuRBCSearch (T *Qp, rbc_dist_id *RID, T *Xp, cl_uint *O, cl_uint *N, rbc_dist_id *NNID, T *NN, uint32_t nq, uint32_t nr, uint32_t nx, uint32_t d) |
Uses the RBC data structure to search for the nearest neighbors. More... | |
template<typename T > | |
void | RBC::cpuRBCSearch8 (T *Qp, rbc_dist_id *RID, T *Xp, cl_uint *O, cl_uint *N, rbc_dist_id *NNID, T *NN, uint32_t nq, uint32_t nr, uint32_t nx, T a) |
Uses the RBC data structure to search for the nearest neighbors. More... | |
template<typename T > | |
void | RBC::cpuNNSearch (T *Q, T *X, T *NN, uint32_t nq, uint32_t nx, uint32_t d) |
Computes (brute force) the nearest neighbors of a set of queries. More... | |
template<typename T > | |
T | RBC::meanError (T *Q, T *NN, uint32_t n, uint32_t d) |
Computes the mean euclidean distance from the queries to their NNs. More... | |
Declarations of helper functions for testing.