32 #ifndef RBC_ALGORITHMS_HPP
33 #define RBC_ALGORITHMS_HPP
35 #include <CLUtils.hpp>
91 template <KernelTypeC K = KernelTypeC::SHARED_NONE>
114 void init (
unsigned int _nx,
unsigned int _nr,
unsigned int _d = 8,
float _a = 1.f,
Staging _staging =
Staging::IO);
117 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
120 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
122 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
134 clutils::CLEnvInfo<1> info;
136 cl::CommandQueue queue;
138 cl::NDRange global, local;
141 unsigned int nx, nr, d;
142 unsigned int bufferXSize, bufferRSize, bufferDSize;
143 cl::Buffer hBufferInX, hBufferInR, hBufferOutD;
144 cl::Buffer dBufferInX, dBufferInR, dBufferOutD;
154 template <
typename period>
155 double run (clutils::GPUTimer<period> &timer,
const std::vector<cl::Event> *events =
nullptr)
157 queue.enqueueNDRangeKernel (kernel, cl::NullRange, global, local, events, &timer.event ());
158 queue.flush (); timer.wait ();
160 return timer.duration ();
197 template <ReduceConfig C,
typename T = cl_
float>
215 Reduce (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _info);
222 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
225 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
227 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
234 clutils::CLEnvInfo<1> info;
236 cl::CommandQueue queue;
237 cl::Kernel recKernel, groupRecKernel;
238 cl::NDRange globalR, globalGR, local;
240 size_t wgMultiple, wgXdim;
241 unsigned int cols, rows;
242 unsigned int bufferInSize, bufferGRSize, bufferOutSize;
243 cl::Buffer hBufferIn, hBufferOut;
244 cl::Buffer dBufferIn, dBufferR, dBufferOut;
254 template <
typename period>
255 double run (clutils::GPUTimer<period> &timer,
const std::vector<cl::Event> *events =
nullptr)
261 queue.enqueueNDRangeKernel (recKernel, cl::NullRange, globalR, local, events, &timer.event ());
262 queue.flush (); timer.wait ();
263 pTime = timer.duration ();
267 queue.enqueueNDRangeKernel (recKernel, cl::NullRange, globalR, local, events, &timer.event ());
268 queue.flush (); timer.wait ();
269 pTime = timer.duration ();
271 queue.enqueueNDRangeKernel (groupRecKernel, cl::NullRange, globalGR, local,
nullptr, &timer.event ());
272 queue.flush (); timer.wait ();
273 pTime += timer.duration ();
332 RBCMin (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _info);
339 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
342 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
344 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
356 clutils::CLEnvInfo<1> info;
358 cl::CommandQueue queue;
359 cl::Kernel initKernel, minsKernel, groupMinsKernel;
360 cl::NDRange globalInit, globalM, globalGM, local;
362 size_t wgMultiple, wgXdim;
364 unsigned int cols, rows;
365 unsigned int bufferDSize, bufferGMSize, bufferIDSize, bufferRnkSize, bufferNSize;
366 cl::Buffer hBufferInD, hBufferOutID, hBufferOutRnk, hBufferOutN;
367 cl::Buffer dBufferInD, dBufferGM, dBufferOutID, dBufferOutRnk, dBufferOutN;
377 template <
typename period>
378 double run (clutils::GPUTimer<period> &timer,
const std::vector<cl::Event> *events =
nullptr)
382 if (accCounters == 1)
384 queue.enqueueNDRangeKernel (initKernel, cl::NullRange, globalInit, cl::NullRange, events, &timer.event ());
385 queue.flush (); timer.wait ();
386 pTime = timer.duration ();
391 queue.enqueueNDRangeKernel (minsKernel, cl::NullRange, globalM, local, events, &timer.event ());
392 queue.flush (); timer.wait ();
393 pTime += timer.duration ();
397 queue.enqueueNDRangeKernel (minsKernel, cl::NullRange, globalM, local, events, &timer.event ());
398 queue.flush (); timer.wait ();
399 pTime += timer.duration ();
401 queue.enqueueNDRangeKernel (groupMinsKernel, cl::NullRange, globalGM, local,
nullptr, &timer.event ());
402 queue.flush (); timer.wait ();
403 pTime += timer.duration ();
443 template <ScanConfig C,
typename T = cl_
int>
461 Scan (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _info);
468 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
471 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
473 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
480 clutils::CLEnvInfo<1> info;
482 cl::CommandQueue queue;
483 cl::Kernel kernelScan, kernelSumsScan, kernelAddSums;
484 cl::NDRange globalScan, globalSumsScan, localScan;
485 cl::NDRange globalAddSums, localAddSums, offsetAddSums;
487 size_t wgMultiple, wgXdim;
488 unsigned int cols, rows, bufferSize, bufferSumsSize;
489 cl::Buffer hBufferIn, hBufferOut;
490 cl::Buffer dBufferIn, dBufferOut, dBufferSums;
500 template <
typename period>
501 double run (clutils::GPUTimer<period> &timer,
const std::vector<cl::Event> *events =
nullptr)
507 queue.enqueueNDRangeKernel (
508 kernelScan, cl::NullRange, globalScan, localScan, events, &timer.event ());
509 queue.flush (); timer.wait ();
510 pTime = timer.duration ();
514 queue.enqueueNDRangeKernel (
515 kernelScan, cl::NullRange, globalScan, localScan, events, &timer.event ());
516 queue.flush (); timer.wait ();
517 pTime = timer.duration ();
519 queue.enqueueNDRangeKernel (
520 kernelSumsScan, cl::NullRange, globalSumsScan, localScan,
nullptr, &timer.event ());
521 queue.flush (); timer.wait ();
522 pTime += timer.duration ();
524 queue.enqueueNDRangeKernel (
525 kernelAddSums, offsetAddSums, globalAddSums, localAddSums,
nullptr, &timer.event ());
526 queue.flush (); timer.wait ();
527 pTime += timer.duration ();
575 template <RBCPermuteConfig C = RBCPermuteConfig::GENERIC>
600 RBCPermute (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _info);
604 void init (
unsigned int _nx,
unsigned int _nr,
unsigned int _d = 8,
int _permID = 0,
Staging _staging =
Staging::IO);
607 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
610 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
612 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
627 clutils::CLEnvInfo<1> info;
629 cl::CommandQueue queue;
634 unsigned int nx, nr, d;
635 unsigned int bufferXSize, bufferIDSize, bufferRnkSize, bufferOSize;
636 cl::Buffer hBufferInX, hBufferInID, hBufferInRnk, hBufferInO, hBufferOutXp, hBufferOutIDp;
637 cl::Buffer dBufferInX, dBufferInID, dBufferInRnk, dBufferInO, dBufferOutXp, dBufferOutIDp;
647 template <
typename period>
648 double run (clutils::GPUTimer<period> &timer,
const std::vector<cl::Event> *events =
nullptr)
650 queue.enqueueNDRangeKernel (kernel, cl::NullRange, global, cl::NullRange, events, &timer.event ());
651 queue.flush (); timer.wait ();
653 return timer.duration ();
698 template <KernelTypeC K, RBCPermuteConfig P>
728 RBCConstruct (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _info);
732 void init (
unsigned int _nx,
unsigned int _nr,
unsigned int _d,
float _a = 1.f,
int _permID = 0,
Staging _staging =
Staging::IO);
735 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
738 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
740 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
762 clutils::CLEnvInfo<1> info;
764 cl::CommandQueue queue;
771 unsigned int nx, nr, d;
772 unsigned int bufferXSize, bufferRSize, bufferDSize, bufferIDSize;
773 unsigned int bufferNSize, bufferOSize, bufferRnkSize;
774 cl::Buffer hBufferInX, hBufferInR, hBufferOutID, hBufferOutRnk, hBufferOutN, hBufferOutO, hBufferOutXp, hBufferOutIDp;
775 cl::Buffer dBufferInX, dBufferInR, dBufferOutID, dBufferOutRnk, dBufferOutN, dBufferOutO, dBufferOutXp, dBufferOutIDp;
785 template <
typename period>
786 double run (clutils::GPUTimer<period> &timer,
const std::vector<cl::Event> *events =
nullptr)
790 pTime = rbcCompDists.
run (timer, events);
791 pTime += rbcMinDists.
run (timer);
792 pTime += rbcScanNLists.
run (timer);
793 pTime += rbcPermDB.
run (timer);
825 template <KernelTypeC K, RBCPermuteConfig P, KernelTypeS S>
870 template <KernelTypeC K, RBCPermuteConfig P>
906 RBCSearch (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _info);
908 cl::Memory&
get (RBCSearch::Memory mem);
910 void init (
unsigned int _nq,
unsigned int _nr,
unsigned int _nx,
unsigned int _d,
Staging _staging =
Staging::IO);
912 void write (RBCSearch::Memory mem = RBCSearch::Memory::D_IN_Q,
void *ptr =
nullptr,
bool block = CL_FALSE,
913 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
915 void* read (RBCSearch::Memory mem = RBCSearch::Memory::H_OUT_NN,
bool block = CL_TRUE,
916 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
918 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr,
bool config =
false);
936 void setExecParams (
const std::vector<cl::Event> *events =
nullptr);
939 clutils::CLEnvInfo<1> info;
941 cl::CommandQueue queue;
942 cl::NDRange globalQXD, localQXD, globalNNID, globalGNNID, globalNN, local;
943 cl::Kernel rbcCompQXDistsKernel, nnidMinsKernel, nnidGroupMinsKernel, rbcNNKernel;
947 size_t wgMultiple, wgXdim;
948 unsigned int nq, nr, nx, d;
949 unsigned int bufferQSize, bufferRSize, bufferXSize, bufferOSize, bufferNSize;
950 unsigned int bufferQXDSize, bufferRIDSize;
951 unsigned int bufferNNIDSize, bufferGNNIDSize, bufferNNSize;
952 cl::Buffer hBufferInQ, hBufferInR, hBufferInXp, hBufferInO, hBufferInN;
953 cl::Buffer dBufferInQ, dBufferInR, dBufferInXp, dBufferInO, dBufferInN;
954 cl::Buffer hBufferOutRID, hBufferOutQp, hBufferOutNNID, hBufferOutNN;
955 cl::Buffer dBufferOutRID, dBufferOutQp, dBufferOutNNID, dBufferOutNN;
956 cl::Buffer dBufferQXD, dBufferOutGNNID;
968 template <
typename period>
969 double run (clutils::GPUTimer<period> &timer,
970 const std::vector<cl::Event> *events =
nullptr,
bool config =
false)
976 if (config) setExecParams (events);
979 pTime = rbcCompRIDs.
run (timer, events);
982 queue.enqueueNDRangeKernel (rbcCompQXDistsKernel,
983 cl::NullRange, globalQXD, localQXD,
nullptr, &timer.event ());
984 queue.flush (); timer.wait ();
985 pTime += timer.duration ();
988 queue.enqueueNDRangeKernel (nnidMinsKernel,
989 cl::NullRange, globalNNID, local,
nullptr, &timer.event ());
990 queue.flush (); timer.wait ();
991 pTime += timer.duration ();
995 queue.enqueueNDRangeKernel (nnidGroupMinsKernel,
996 cl::NullRange, globalGNNID, local,
nullptr, &timer.event ());
997 queue.flush (); timer.wait ();
998 pTime += timer.duration ();
1002 queue.enqueueNDRangeKernel (rbcNNKernel,
1003 cl::NullRange, globalNN, cl::NullRange,
nullptr, &timer.event ());
1004 queue.flush (); timer.wait ();
1005 pTime += timer.duration ();
1054 template <KernelTypeC K, RBCPermuteConfig P>
1090 RBCSearch (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _info);
1092 cl::Memory&
get (RBCSearch::Memory mem);
1094 void init (
unsigned int _nq,
unsigned int _nr,
unsigned int _nx,
float _a = 1.f,
Staging _staging =
Staging::IO);
1096 void write (RBCSearch::Memory mem = RBCSearch::Memory::D_IN_Q,
void *ptr =
nullptr,
bool block = CL_FALSE,
1097 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
1099 void* read (RBCSearch::Memory mem = RBCSearch::Memory::H_OUT_NN,
bool block = CL_TRUE,
1100 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
1102 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr,
bool config =
false);
1106 void setAlpha (
float _a);
1124 void setExecParams (
const std::vector<cl::Event> *events =
nullptr);
1126 clutils::CLEnv &env;
1127 clutils::CLEnvInfo<1> info;
1128 cl::Context context;
1129 cl::CommandQueue queue;
1130 cl::NDRange globalQXD, localQXD, globalNNID, globalGNNID, globalNN, local;
1131 cl::Kernel rbcCompQXDistsKernel, nnidMinsKernel, nnidGroupMinsKernel, rbcNNKernel;
1136 size_t wgMultiple, wgXdim;
1137 unsigned int nq, nr, nx, d;
1138 unsigned int bufferQSize, bufferRSize, bufferXSize, bufferOSize, bufferNSize;
1139 unsigned int bufferQXDSize, bufferRIDSize;
1140 unsigned int bufferNNIDSize, bufferGNNIDSize, bufferNNSize;
1141 cl::Buffer hBufferInQ, hBufferInR, hBufferInXp, hBufferInO, hBufferInN;
1142 cl::Buffer dBufferInQ, dBufferInR, dBufferInXp, dBufferInO, dBufferInN;
1143 cl::Buffer hBufferOutRID, hBufferOutQp, hBufferOutNNID, hBufferOutNN;
1144 cl::Buffer dBufferOutRID, dBufferOutQp, dBufferOutNNID, dBufferOutNN;
1145 cl::Buffer dBufferQXD, dBufferOutGNNID;
1157 template <
typename period>
1158 double run (clutils::GPUTimer<period> &timer,
1159 const std::vector<cl::Event> *events =
nullptr,
bool config =
false)
1165 if (config) setExecParams (events);
1168 pTime = rbcCompRIDs.
run (timer, events);
1171 queue.enqueueNDRangeKernel (rbcCompQXDistsKernel,
1172 cl::NullRange, globalQXD, localQXD,
nullptr, &timer.event ());
1173 queue.flush (); timer.wait ();
1174 pTime += timer.duration ();
1177 queue.enqueueNDRangeKernel (nnidMinsKernel,
1178 cl::NullRange, globalNNID, local,
nullptr, &timer.event ());
1179 queue.flush (); timer.wait ();
1180 pTime += timer.duration ();
1184 queue.enqueueNDRangeKernel (nnidGroupMinsKernel,
1185 cl::NullRange, globalGNNID, local,
nullptr, &timer.event ());
1186 queue.flush (); timer.wait ();
1187 pTime += timer.duration ();
1191 queue.enqueueNDRangeKernel (rbcNNKernel,
1192 cl::NullRange, globalNN, cl::NullRange,
nullptr, &timer.event ());
1193 queue.flush (); timer.wait ();
1194 pTime += timer.duration ();
1204 #endif // RBC_ALGORITHMS_HPP
cl_float * hPtrInXp
Definition: algorithms.hpp:922
Reduce(clutils::CLEnv &_env, clutils::CLEnvInfo< 1 > _info)
Configures an OpenCL environment as specified by _info.
void setAlpha(float _a)
Sets the scaling factor .
Definition: algorithms.cpp:404
cl_float * hPtrInR
Definition: algorithms.hpp:747
cl_float * hPtrInR
Definition: algorithms.hpp:921
T * hPtrOut
Definition: algorithms.hpp:230
Memory
Enumerates the memory objects handled by the class.
Definition: algorithms.hpp:878
Interface class for the rbcPermute kernel.
Definition: algorithms.hpp:576
RBCPermute(clutils::CLEnv &_env, clutils::CLEnvInfo< 1 > _info)
Configures an OpenCL environment as specified by _info.
Definition: algorithms.cpp:1297
double run(clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr)
Executes the necessary kernels.
Definition: algorithms.hpp:155
void write(RBCPermute::Memory mem=RBCPermute::Memory::D_IN_X, void *ptr=nullptr, bool block=CL_FALSE, const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Performs a data transfer to a device buffer.
Definition: algorithms.cpp:1507
rbc_dist_id * hPtrOutRID
Definition: algorithms.hpp:927
void init(unsigned int _cols, unsigned int _rows, Staging _staging=Staging::IO)
Configures kernel execution parameters.
Definition: algorithms.cpp:1078
cl_uint * hPtrInO
Definition: algorithms.hpp:619
cl_float * hPtrInR
Definition: algorithms.hpp:1109
rbc_dist_id * hPtrOutIDp
Definition: algorithms.hpp:622
Interface class for the scan kernel.
Definition: algorithms.hpp:444
T * hPtrIn
Definition: algorithms.hpp:229
void * read(RBCPermute::Memory mem=RBCPermute::Memory::H_OUT_X_P, bool block=CL_TRUE, const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Performs a data transfer to a staging buffer.
Definition: algorithms.cpp:1551
Scan(clutils::CLEnv &_env, clutils::CLEnvInfo< 1 > _info)
Configures an OpenCL environment as specified by _info.
void init(unsigned int _nx, unsigned int _nr, unsigned int _d, float _a=1.f, int _permID=0, Staging _staging=Staging::IO)
Configures kernel execution parameters.
Definition: algorithms.cpp:1673
RBCComputeDists(clutils::CLEnv &_env, clutils::CLEnvInfo< 1 > _info)
Configures an OpenCL environment as specified by _info.
Definition: algorithms.cpp:54
Interface class for the reduce kernels.
Definition: algorithms.hpp:198
double run(clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr)
Executes the necessary kernels.
Definition: algorithms.hpp:501
Memory
Enumerates the memory objects handled by the class.
Definition: algorithms.hpp:205
Memory
Enumerates the memory objects handled by the class.
Definition: algorithms.hpp:451
cl_float * hPtrOutQp
Definition: algorithms.hpp:929
cl_float * hPtrOutD
Definition: algorithms.hpp:130
double run(clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr)
Executes the necessary kernels.
Definition: algorithms.hpp:255
void * read(RBCMin::Memory mem=RBCMin::Memory::H_OUT_ID, bool block=CL_TRUE, const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Performs a data transfer to a staging buffer.
Definition: algorithms.cpp:960
cl_float * hPtrOutXp
Definition: algorithms.hpp:756
cl_float * hPtrInX
Definition: algorithms.hpp:128
T * hPtrOut
Definition: algorithms.hpp:476
cl_uint * hPtrOutRnk
Definition: algorithms.hpp:750
Declarations of data types used by the Random Ball Cover data structure.
Offers classes which set up kernel execution parameters and provide interfaces for the handling of me...
Definition: algorithms.hpp:43
cl_float * hPtrOutQp
Definition: algorithms.hpp:1117
cl_float * hPtrOutNN
Definition: algorithms.hpp:1119
void write(RBCComputeDists::Memory mem=RBCComputeDists::Memory::D_IN_X, void *ptr=nullptr, bool block=CL_FALSE, const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Performs a data transfer to a device buffer.
Definition: algorithms.cpp:319
void run(const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Executes the necessary kernels.
Definition: algorithms.cpp:377
void run(const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Executes the necessary kernels.
Definition: algorithms.cpp:689
cl_uint * hPtrOutN
Definition: algorithms.hpp:351
Declares classes used by the OpenCL interface classes in cl_algo.
ReduceConfig
Enumerates configurations for the Reduce class.
Definition: algorithms.hpp:167
cl_float * hPtrInQ
Definition: algorithms.hpp:920
Interface class for searching for nearest neighbors, of a set of queries, in the Random Ball Cover da...
Definition: algorithms.hpp:826
void run(const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Executes the necessary kernels.
Definition: algorithms.cpp:1910
float getAlpha()
Gets the scaling factor .
Definition: algorithms.cpp:390
cl_uint * hPtrOutRnk
Definition: algorithms.hpp:349
Staging
Enumerates staging buffer configurations.
Definition: common.hpp:43
void write(RBCConstruct::Memory mem=RBCConstruct::Memory::D_IN_X, void *ptr=nullptr, bool block=CL_FALSE, const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Performs a data transfer to a device buffer.
Definition: algorithms.cpp:1836
rbc_dist_id * hPtrOutIDp
Definition: algorithms.hpp:757
void setAlpha(float _a)
Sets the scaling factor .
Definition: algorithms.cpp:1940
Struct holding a value and a key.
Definition: data_types.hpp:43
double run(clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr)
Executes the necessary kernels.
Definition: algorithms.hpp:786
T * hPtrIn
Definition: algorithms.hpp:475
void * read(Scan::Memory mem=Scan::Memory::H_OUT, bool block=CL_TRUE, const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Performs a data transfer to a staging buffer.
Definition: algorithms.cpp:1242
void * read(RBCConstruct::Memory mem=RBCConstruct::Memory::H_OUT_X_P, bool block=CL_TRUE, const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Performs a data transfer to a staging buffer.
Definition: algorithms.cpp:1870
cl_uint * hPtrOutN
Definition: algorithms.hpp:752
cl_float * hPtrOutXp
Definition: algorithms.hpp:621
rbc_dist_id * hPtrOutID
Definition: algorithms.hpp:347
double run(clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr, bool config=false)
Executes the necessary kernels.
Definition: algorithms.hpp:969
cl_uint * hPtrInO
Definition: algorithms.hpp:923
cl_uint * hPtrInO
Definition: algorithms.hpp:1111
Memory
Enumerates the memory objects handled by the class.
Definition: algorithms.hpp:583
Definition: helper_funcs.hpp:44
ScanConfig
Enumerates configurations for the Scan class.
Definition: algorithms.hpp:413
void init(unsigned int _nx, unsigned int _nr, unsigned int _d=8, int _permID=0, Staging _staging=Staging::IO)
Configures kernel execution parameters.
Definition: algorithms.cpp:1363
RBCConstruct(clutils::CLEnv &_env, clutils::CLEnvInfo< 1 > _info)
Configures an OpenCL environment as specified by _info.
Definition: algorithms.cpp:1595
rbc_dist_id * hPtrOutID
Definition: algorithms.hpp:748
unsigned int max_n
Definition: algorithms.hpp:933
rbc_dist_id * hPtrInID
Definition: algorithms.hpp:615
Interface class for the rbcComputeDists kernels.
Definition: algorithms.hpp:92
void * read(RBCComputeDists::Memory mem=RBCComputeDists::Memory::H_OUT_D, bool block=CL_TRUE, const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Performs a data transfer to a staging buffer.
Definition: algorithms.cpp:353
cl_float * hPtrInR
Definition: algorithms.hpp:129
Interface class for the rbcMinDists kernel.
Definition: algorithms.hpp:311
cl_float * hPtrInQ
Definition: algorithms.hpp:1108
double run(clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr, bool config=false)
Executes the necessary kernels.
Definition: algorithms.hpp:1158
void init(unsigned int _nx, unsigned int _nr, unsigned int _d=8, float _a=1.f, Staging _staging=Staging::IO)
Configures kernel execution parameters.
Definition: algorithms.cpp:131
Memory
Enumerates the memory objects handled by the class.
Definition: algorithms.hpp:99
cl_float * hPtrOutNN
Definition: algorithms.hpp:931
cl_uint * hPtrInRnk
Definition: algorithms.hpp:617
rbc_dist_id * hPtrOutNNID
Definition: algorithms.hpp:930
cl_uint * hPtrInN
Definition: algorithms.hpp:1113
void * read(Reduce::Memory mem=Reduce::Memory::H_OUT, bool block=CL_TRUE, const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Performs a data transfer to a staging buffer.
Definition: algorithms.cpp:665
unsigned int max_n
Definition: algorithms.hpp:1121
double run(clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr)
Executes the necessary kernels.
Definition: algorithms.hpp:648
cl_uint * hPtrOutO
Definition: algorithms.hpp:754
rbc_dist_id * hPtrOutNNID
Definition: algorithms.hpp:1118
cl_uint * hPtrInN
Definition: algorithms.hpp:925
cl_float * hPtrInD
Definition: algorithms.hpp:346
void write(Scan::Memory mem=Scan::Memory::D_IN, void *ptr=nullptr, bool block=CL_FALSE, const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Performs a data transfer to a device buffer.
Definition: algorithms.cpp:1213
void write(RBCMin::Memory mem=RBCMin::Memory::D_IN_D, void *ptr=nullptr, bool block=CL_FALSE, const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Performs a data transfer to a device buffer.
Definition: algorithms.cpp:932
Interface class for constructing the Random Ball Cover data structure.
Definition: algorithms.hpp:699
void run(const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Executes the necessary kernels.
Definition: algorithms.cpp:1266
float getAlpha()
Gets the scaling factor .
Definition: algorithms.cpp:1926
void run(const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Executes the necessary kernels.
Definition: algorithms.cpp:1579
void run(const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Executes the necessary kernels.
Definition: algorithms.cpp:991
double run(clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr)
Executes the necessary kernels.
Definition: algorithms.hpp:378
Memory
Enumerates the memory objects handled by the class.
Definition: algorithms.hpp:318
RBCMin(clutils::CLEnv &_env, clutils::CLEnvInfo< 1 > _info)
Configures an OpenCL environment as specified by _info.
Definition: algorithms.cpp:712
rbc_dist_id * hPtrOutRID
Definition: algorithms.hpp:1115
void write(Reduce::Memory mem=Reduce::Memory::D_IN, void *ptr=nullptr, bool block=CL_FALSE, const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Performs a data transfer to a device buffer.
Definition: algorithms.cpp:636
void init(unsigned int _cols, unsigned int _rows, int _accCounters=1, Staging _staging=Staging::IO)
Configures kernel execution parameters.
Definition: algorithms.cpp:767
KernelTypeC
Enumerates the kernels available for computing the array of distances in the construction step...
Definition: algorithms.hpp:53
Memory
Enumerates the memory objects handled by the class.
Definition: algorithms.hpp:706
cl_float * hPtrInXp
Definition: algorithms.hpp:1110
void init(unsigned int _cols, unsigned int _rows, Staging _staging=Staging::IO)
Configures kernel execution parameters.
Definition: algorithms.cpp:510
RBCPermuteConfig
Enumerates configurations for the RBCPermute class.
Definition: algorithms.hpp:537
cl_float * hPtrInX
Definition: algorithms.hpp:746
Memory
Enumerates the memory objects handled by the class.
Definition: algorithms.hpp:1062
KernelTypeS
Enumerates the kernels available for computing the array of distances (Q-X[L]) during search...
Definition: algorithms.hpp:803
cl_float * hPtrInX
Definition: algorithms.hpp:614