32 #ifndef ICP_ALGORITHMS_HPP
33 #define ICP_ALGORITHMS_HPP
35 #include <CLUtils.hpp>
37 #include <RBC/data_types.hpp>
38 #include <RBC/algorithms.hpp>
39 #include <eigen3/Eigen/Dense>
83 template <ReduceConfig C,
typename T = cl_
float>
101 Reduce (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _info);
108 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
111 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
113 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
120 clutils::CLEnvInfo<1> info;
122 cl::CommandQueue queue;
123 cl::Kernel recKernel, groupRecKernel;
124 cl::NDRange globalR, globalGR, local;
126 size_t wgMultiple, wgXdim;
127 unsigned int cols, rows;
128 unsigned int bufferInSize, bufferGRSize, bufferOutSize;
129 cl::Buffer hBufferIn, hBufferOut;
130 cl::Buffer dBufferIn, dBufferR, dBufferOut;
140 template <
typename period>
141 double run (clutils::GPUTimer<period> &timer,
const std::vector<cl::Event> *events =
nullptr)
147 queue.enqueueNDRangeKernel (recKernel, cl::NullRange, globalR, local, events, &timer.event ());
148 queue.flush (); timer.wait ();
149 pTime = timer.duration ();
153 queue.enqueueNDRangeKernel (recKernel, cl::NullRange, globalR, local, events, &timer.event ());
154 queue.flush (); timer.wait ();
155 pTime = timer.duration ();
157 queue.enqueueNDRangeKernel (groupRecKernel, cl::NullRange, globalGR, local,
nullptr, &timer.event ());
158 queue.flush (); timer.wait ();
159 pTime += timer.duration ();
199 template <ScanConfig C,
typename T = cl_
int>
217 Scan (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _info);
224 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
227 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
229 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
236 clutils::CLEnvInfo<1> info;
238 cl::CommandQueue queue;
239 cl::Kernel kernelScan, kernelSumsScan, kernelAddSums;
240 cl::NDRange globalScan, globalSumsScan, localScan;
241 cl::NDRange globalAddSums, localAddSums, offsetAddSums;
243 size_t wgMultiple, wgXdim;
244 unsigned int cols, rows, bufferSize, bufferSumsSize;
245 cl::Buffer hBufferIn, hBufferOut;
246 cl::Buffer dBufferIn, dBufferOut, dBufferSums;
256 template <
typename period>
257 double run (clutils::GPUTimer<period> &timer,
const std::vector<cl::Event> *events =
nullptr)
263 queue.enqueueNDRangeKernel (
264 kernelScan, cl::NullRange, globalScan, localScan, events, &timer.event ());
265 queue.flush (); timer.wait ();
266 pTime = timer.duration ();
270 queue.enqueueNDRangeKernel (
271 kernelScan, cl::NullRange, globalScan, localScan, events, &timer.event ());
272 queue.flush (); timer.wait ();
273 pTime = timer.duration ();
275 queue.enqueueNDRangeKernel (
276 kernelSumsScan, cl::NullRange, globalSumsScan, localScan,
nullptr, &timer.event ());
277 queue.flush (); timer.wait ();
278 pTime += timer.duration ();
280 queue.enqueueNDRangeKernel (
281 kernelAddSums, offsetAddSums, globalAddSums, localAddSums,
nullptr, &timer.event ());
282 queue.flush (); timer.wait ();
283 pTime += timer.duration ();
328 ICPLMs (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _info);
335 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
338 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
340 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
347 clutils::CLEnvInfo<1> info;
349 cl::CommandQueue queue;
353 unsigned int n, m, d;
354 unsigned int bufferInSize, bufferOutSize;
355 cl::Buffer hBufferIn, hBufferOut, dBufferIn, dBufferOut;
365 template <
typename period>
366 double run (clutils::GPUTimer<period> &timer,
const std::vector<cl::Event> *events =
nullptr)
368 queue.enqueueNDRangeKernel (kernel, cl::NullRange, global, cl::NullRange, events, &timer.event ());
369 queue.flush (); timer.wait ();
371 return timer.duration ();
413 ICPReps (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _info);
420 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
423 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
425 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
432 clutils::CLEnvInfo<1> info;
434 cl::CommandQueue queue;
438 unsigned int m, nr, nrx, nry, d;
439 unsigned int bufferInSize, bufferOutSize;
440 cl::Buffer hBufferIn, hBufferOut, dBufferIn, dBufferOut;
450 template <
typename period>
451 double run (clutils::GPUTimer<period> &timer,
const std::vector<cl::Event> *events =
nullptr)
453 queue.enqueueNDRangeKernel (kernel, cl::NullRange, global, cl::NullRange, events, &timer.event ());
454 queue.flush (); timer.wait ();
456 return timer.duration ();
506 ICPWeights (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _info);
513 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
516 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
518 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
526 clutils::CLEnvInfo<1> info;
528 cl::CommandQueue queue;
529 cl::Kernel weightKernel, groupWeightKernel;
530 cl::NDRange globalW, globalGW, local;
532 size_t wgMultiple, wgXdim;
534 unsigned int bufferInSize, bufferOutWSize, bufferGWSize, bufferOutSWSize;
535 cl::Buffer hBufferIn, hBufferOutW, hBufferOutSW;
536 cl::Buffer dBufferIn, dBufferOutW, dBufferOutSW;
537 cl::Buffer dBufferGW;
547 template <
typename period>
548 double run (clutils::GPUTimer<period> &timer,
const std::vector<cl::Event> *events =
nullptr)
554 queue.enqueueNDRangeKernel (weightKernel, cl::NullRange, globalW, local, events, &timer.event ());
555 queue.flush (); timer.wait ();
556 pTime = timer.duration ();
560 queue.enqueueNDRangeKernel (weightKernel, cl::NullRange, globalW, local, events, &timer.event ());
561 queue.flush (); timer.wait ();
562 pTime = timer.duration ();
564 queue.enqueueNDRangeKernel (groupWeightKernel, cl::NullRange, globalGW, local,
nullptr, &timer.event ());
565 queue.flush (); timer.wait ();
566 pTime += timer.duration ();
595 template <ICPMeanConfig C>
646 ICPMean (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _info);
648 cl::Memory&
get (ICPMean::Memory mem);
652 void write (ICPMean::Memory mem = ICPMean::Memory::D_IN_F,
void *ptr =
nullptr,
bool block = CL_FALSE,
653 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
655 void* read (ICPMean::Memory mem = ICPMean::Memory::H_OUT,
bool block = CL_TRUE,
656 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
658 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
666 clutils::CLEnvInfo<1> info;
668 cl::CommandQueue queue;
669 cl::Kernel meanKernel, groupMeanKernel;
670 cl::NDRange globalM, globalGM, local;
672 size_t wgMultiple, wgXdim;
674 unsigned int bufferInSize, bufferGMSize, bufferOutSize;
675 cl::Buffer hBufferInF, hBufferInM, hBufferOut;
676 cl::Buffer dBufferInF, dBufferInM, dBufferGM, dBufferOut;
686 template <
typename period>
687 double run (clutils::GPUTimer<period> &timer,
const std::vector<cl::Event> *events =
nullptr)
693 queue.enqueueNDRangeKernel (meanKernel, cl::NullRange, globalM, local, events, &timer.event ());
694 queue.flush (); timer.wait ();
695 pTime = timer.duration ();
699 queue.enqueueNDRangeKernel (meanKernel, cl::NullRange, globalM, local, events, &timer.event ());
700 queue.flush (); timer.wait ();
701 pTime = timer.duration ();
703 queue.enqueueNDRangeKernel (groupMeanKernel, cl::NullRange, globalGM, local,
nullptr, &timer.event ());
704 queue.flush (); timer.wait ();
705 pTime += timer.duration ();
769 ICPMean (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _info);
771 cl::Memory&
get (ICPMean::Memory mem);
775 void write (ICPMean::Memory mem = ICPMean::Memory::D_IN_F,
void *ptr =
nullptr,
bool block = CL_FALSE,
776 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
778 void* read (ICPMean::Memory mem = ICPMean::Memory::H_OUT,
bool block = CL_TRUE,
779 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
781 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
791 clutils::CLEnvInfo<1> info;
793 cl::CommandQueue queue;
794 cl::Kernel meanKernel, groupMeanKernel;
795 cl::NDRange globalM, globalGM, local;
797 size_t wgMultiple, wgXdim;
799 unsigned int bufferInFMSize, bufferInWSize, bufferInSWSize, bufferGMSize, bufferOutSize;
800 cl::Buffer hBufferInF, hBufferInM, hBufferInW, hBufferInSW, hBufferOut;
801 cl::Buffer dBufferInF, dBufferInM, dBufferInW, dBufferInSW, dBufferOut;
802 cl::Buffer dBufferGM;
812 template <
typename period>
813 double run (clutils::GPUTimer<period> &timer,
const std::vector<cl::Event> *events =
nullptr)
819 queue.enqueueNDRangeKernel (meanKernel, cl::NullRange, globalM, local, events, &timer.event ());
820 queue.flush (); timer.wait ();
821 pTime = timer.duration ();
825 queue.enqueueNDRangeKernel (meanKernel, cl::NullRange, globalM, local, events, &timer.event ());
826 queue.flush (); timer.wait ();
827 pTime = timer.duration ();
829 queue.enqueueNDRangeKernel (groupMeanKernel, cl::NullRange, globalGM, local,
nullptr, &timer.event ());
830 queue.flush (); timer.wait ();
831 pTime += timer.duration ();
889 ICPDevs (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _info);
896 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
899 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
901 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
911 clutils::CLEnvInfo<1> info;
913 cl::CommandQueue queue;
918 unsigned int bufferInFMSize, bufferInMeanSize, bufferOutSize;
919 cl::Buffer hBufferInF, hBufferInM, hBufferInMean, hBufferOutDF, hBufferOutDM;
920 cl::Buffer dBufferInF, dBufferInM, dBufferInMean, dBufferOutDF, dBufferOutDM;
930 template <
typename period>
931 double run (clutils::GPUTimer<period> &timer,
const std::vector<cl::Event> *events =
nullptr)
933 queue.enqueueNDRangeKernel (kernel, cl::NullRange, global, cl::NullRange, events, &timer.event ());
934 queue.flush (); timer.wait ();
936 return timer.duration ();
961 template <ICPSConfig C>
1012 ICPS (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _info);
1014 cl::Memory&
get (ICPS::Memory mem);
1018 void write (ICPS::Memory mem = ICPS::Memory::D_IN_DEV_M,
void *ptr =
nullptr,
bool block = CL_FALSE,
1019 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
1021 void* read (ICPS::Memory mem = ICPS::Memory::H_OUT,
bool block = CL_TRUE,
1022 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
1024 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
1026 float getScaling ();
1028 void setScaling (
float _c);
1035 clutils::CLEnv &env;
1036 clutils::CLEnvInfo<1> info;
1037 cl::Context context;
1038 cl::CommandQueue queue;
1045 unsigned int bufferInSize, bufferSijSize, bufferOutSize;
1046 cl::Buffer hBufferInDM, hBufferInDF, hBufferSij, hBufferOut;
1047 cl::Buffer dBufferInDM, dBufferInDF, dBufferSij, dBufferOut;
1057 template <
typename period>
1058 double run (clutils::GPUTimer<period> &timer,
const std::vector<cl::Event> *events =
nullptr)
1062 queue.enqueueNDRangeKernel (kernel, cl::NullRange, global, cl::NullRange, events, &timer.event ());
1063 queue.flush (); timer.wait ();
1064 pTime = timer.duration ();
1066 pTime += reduceSij.
run (timer);
1125 ICPS (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _info);
1127 cl::Memory&
get (ICPS::Memory mem);
1131 void write (ICPS::Memory mem = ICPS::Memory::D_IN_DEV_M,
void *ptr =
nullptr,
bool block = CL_FALSE,
1132 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
1134 void* read (ICPS::Memory mem = ICPS::Memory::H_OUT,
bool block = CL_TRUE,
1135 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
1137 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
1139 float getScaling ();
1141 void setScaling (
float _c);
1149 clutils::CLEnv &env;
1150 clutils::CLEnvInfo<1> info;
1151 cl::Context context;
1152 cl::CommandQueue queue;
1159 unsigned int bufferInFMSize, bufferInWSize, bufferSijSize, bufferOutSize;
1160 cl::Buffer hBufferInDM, hBufferInDF, hBufferInW, hBufferSij, hBufferOut;
1161 cl::Buffer dBufferInDM, dBufferInDF, dBufferInW, dBufferSij, dBufferOut;
1171 template <
typename period>
1172 double run (clutils::GPUTimer<period> &timer,
const std::vector<cl::Event> *events =
nullptr)
1176 queue.enqueueNDRangeKernel (kernel, cl::NullRange, global, cl::NullRange, events, &timer.event ());
1177 queue.flush (); timer.wait ();
1178 pTime = timer.duration ();
1180 pTime += reduceSij.
run (timer);
1210 template <ICPTransformConfig C>
1272 ICPTransform (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _info);
1274 cl::Memory&
get (ICPTransform::Memory mem);
1278 void write (ICPTransform::Memory mem = ICPTransform::Memory::D_IN_M,
void *ptr =
nullptr,
bool block = CL_FALSE,
1279 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
1281 void* read (ICPTransform::Memory mem = ICPTransform::Memory::H_OUT,
bool block = CL_TRUE,
1282 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
1284 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
1291 clutils::CLEnv &env;
1292 clutils::CLEnvInfo<1> info;
1293 cl::Context context;
1294 cl::CommandQueue queue;
1299 unsigned int bufferInMSize, bufferInTSize, bufferOutSize;
1300 cl::Buffer hBufferInM, hBufferInT, hBufferOut;
1301 cl::Buffer dBufferInM, dBufferInT, dBufferOut;
1311 template <
typename period>
1312 double run (clutils::GPUTimer<period> &timer,
const std::vector<cl::Event> *events =
nullptr)
1314 queue.enqueueNDRangeKernel (kernel, cl::NullRange, global, cl::NullRange, events, &timer.event ());
1315 queue.flush (); timer.wait ();
1317 return timer.duration ();
1376 ICPTransform (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _info);
1378 cl::Memory&
get (ICPTransform::Memory mem);
1382 void write (ICPTransform::Memory mem = ICPTransform::Memory::D_IN_M,
void *ptr =
nullptr,
bool block = CL_FALSE,
1383 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
1385 void* read (ICPTransform::Memory mem = ICPTransform::Memory::H_OUT,
bool block = CL_TRUE,
1386 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
1388 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
1395 clutils::CLEnv &env;
1396 clutils::CLEnvInfo<1> info;
1397 cl::Context context;
1398 cl::CommandQueue queue;
1403 unsigned int bufferInMSize, bufferInTSize, bufferOutSize;
1404 cl::Buffer hBufferInM, hBufferInT, hBufferOut;
1405 cl::Buffer dBufferInM, dBufferInT, dBufferOut;
1415 template <
typename period>
1416 double run (clutils::GPUTimer<period> &timer,
const std::vector<cl::Event> *events =
nullptr)
1418 queue.enqueueNDRangeKernel (kernel, cl::NullRange, global, cl::NullRange, events, &timer.event ());
1419 queue.flush (); timer.wait ();
1421 return timer.duration ();
1489 ICPPowerMethod (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _info);
1496 void *ptr =
nullptr,
bool block = CL_FALSE,
1497 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
1500 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
1502 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
1509 clutils::CLEnv &env;
1510 clutils::CLEnvInfo<1> info;
1511 cl::Context context;
1512 cl::CommandQueue queue;
1516 unsigned int bufferInSSize, bufferInMeanSize, bufferOutTkSize;
1517 cl::Buffer hBufferInS, hBufferInMean, hBufferOutTk;
1518 cl::Buffer dBufferInS, dBufferInMean, dBufferOutTk;
1528 template <
typename period>
1529 double run (clutils::GPUTimer<period> &timer,
const std::vector<cl::Event> *events =
nullptr)
1531 queue.enqueueTask (kernel, events, &timer.event ());
1532 queue.flush (); timer.wait ();
1534 return timer.duration ();
1582 template <ICPStepConfigT CR, ICPStepConfigW CW>
1650 ICPStep (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _infoRBC, clutils::CLEnvInfo<1> _infoICP);
1652 cl::Memory&
get (ICPStep::Memory mem);
1654 void init (
unsigned int _m,
unsigned int _nr,
1657 void write (ICPStep::Memory mem = ICPStep::Memory::D_IN_F,
void *ptr =
nullptr,
bool block = CL_FALSE,
1658 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
1660 void* read (ICPStep::Memory mem = ICPStep::Memory::H_IO_T,
bool block = CL_TRUE,
1661 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
1663 void buildRBC (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
1665 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr,
bool config =
false);
1671 void setAlpha (
float _a);
1673 float getScaling ();
1675 void setScaling (
float _c);
1694 Eigen::Quaternionf
q;
1710 <RBC::KernelTypeC::KINECT_R, RBC::RBCPermuteConfig::GENERIC>
rbcC;
1713 <RBC::KernelTypeC::KINECT_R,
1714 RBC::RBCPermuteConfig::GENERIC, RBC::KernelTypeS::KINECT>
rbcS;
1739 template <
typename period>
1740 double run (clutils::GPUTimer<period> &timer,
1741 const std::vector<cl::Event> *events =
nullptr,
bool config =
false)
1743 clutils::CPUTimer<double, std::milli> cTimer;
1746 pTime += transform.
run (timer, events);
1747 pTime += rbcS.run (timer,
nullptr, config);
1748 pTime += means.
run (timer);
1749 pTime += devs.
run (timer);
1750 pTime += matrixS.
run (timer);
1756 sk = std::sqrt (Sij[9] / Sij[10]);
1758 mf = Eigen::Map<Eigen::Vector3f> (mean);
1759 mm = Eigen::Map<Eigen::Vector3f> (mean + 4);
1760 S = Eigen::Map<Eigen::Matrix3f, Eigen::Unaligned, Eigen::Stride<1, 3> > (Sij);
1762 Eigen::JacobiSVD<Eigen::MatrixXf, Eigen::NoQRPreconditioner>
1763 svd (S, Eigen::ComputeThinU | Eigen::ComputeThinV);
1765 Rk = svd.matrixV () * svd.matrixU ().transpose ();
1766 if (Rk.determinant () < 0)
1768 Eigen::Matrix3f B = Eigen::Matrix3f::Identity ();
1769 B (2, 2) = Rk.determinant ();
1770 Rk = svd.matrixV () * B * svd.matrixU ().transpose ();
1772 qk = Eigen::Quaternionf (Rk);
1774 tk = mf - sk * Rk * mm;
1777 q = Eigen::Quaternionf (R);
1778 t = sk * Rk * t + tk;
1781 Eigen::Map<Eigen::Vector4f> (hPtrIOT, 4) = q.coeffs ();
1782 Eigen::Map<Eigen::Vector4f> (hPtrIOT + 4, 4) = t.homogeneous ();
1785 pTime += cTimer.stop ();
1787 queue.enqueueWriteBuffer (dBufferIOT, CL_FALSE, 0, bufferTSize, hPtrIOT,
nullptr, &timer.event ());
1788 queue.flush (); timer.wait ();
1789 pTime += timer.duration ();
1861 ICPStep (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _infoRBC, clutils::CLEnvInfo<1> _infoICP);
1863 cl::Memory&
get (ICPStep::Memory mem);
1865 void init (
unsigned int _m,
unsigned int _nr,
1868 void write (ICPStep::Memory mem = ICPStep::Memory::D_IN_F,
void *ptr =
nullptr,
bool block = CL_FALSE,
1869 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
1871 void* read (ICPStep::Memory mem = ICPStep::Memory::H_IO_T,
bool block = CL_TRUE,
1872 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
1874 void buildRBC (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
1876 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr,
bool config =
false);
1882 void setAlpha (
float _a);
1884 float getScaling ();
1886 void setScaling (
float _c);
1905 Eigen::Quaternionf
q;
1921 <RBC::KernelTypeC::KINECT_R, RBC::RBCPermuteConfig::GENERIC>
rbcC;
1924 <RBC::KernelTypeC::KINECT_R,
1925 RBC::RBCPermuteConfig::GENERIC, RBC::KernelTypeS::KINECT>
rbcS;
1951 template <
typename period>
1952 double run (clutils::GPUTimer<period> &timer,
1953 const std::vector<cl::Event> *events =
nullptr,
bool config =
false)
1955 clutils::CPUTimer<double, std::milli> cTimer;
1958 pTime += transform.
run (timer, events);
1959 pTime += rbcS.run (timer,
nullptr, config);
1960 pTime += weights.
run (timer);
1961 pTime += means.
run (timer);
1962 pTime += devs.
run (timer);
1963 pTime += matrixS.
run (timer);
1969 sk = std::sqrt (Sij[9] / Sij[10]);
1971 mf = Eigen::Map<Eigen::Vector3f> (mean);
1972 mm = Eigen::Map<Eigen::Vector3f> (mean + 4);
1973 S = Eigen::Map<Eigen::Matrix3f, Eigen::Unaligned, Eigen::Stride<1, 3> > (Sij);
1975 Eigen::JacobiSVD<Eigen::MatrixXf, Eigen::NoQRPreconditioner>
1976 svd (S, Eigen::ComputeThinU | Eigen::ComputeThinV);
1978 Rk = svd.matrixV () * svd.matrixU ().transpose ();
1979 if (Rk.determinant () < 0)
1981 Eigen::Matrix3f B = Eigen::Matrix3f::Identity ();
1982 B (2, 2) = Rk.determinant ();
1983 Rk = svd.matrixV () * B * svd.matrixU ().transpose ();
1985 qk = Eigen::Quaternionf (Rk);
1987 tk = mf - sk * Rk * mm;
1990 q = Eigen::Quaternionf (R);
1991 t = sk * Rk * t + tk;
1994 Eigen::Map<Eigen::Vector4f> (hPtrIOT, 4) = q.coeffs ();
1995 Eigen::Map<Eigen::Vector4f> (hPtrIOT + 4, 4) = t.homogeneous ();
1998 pTime += cTimer.stop ();
2000 queue.enqueueWriteBuffer (dBufferIOT, CL_FALSE, 0, bufferTSize, hPtrIOT,
nullptr, &timer.event ());
2001 queue.flush (); timer.wait ();
2002 pTime += timer.duration ();
2074 ICPStep (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _infoRBC, clutils::CLEnvInfo<1> _infoICP);
2076 cl::Memory&
get (ICPStep::Memory mem);
2078 void init (
unsigned int _m,
unsigned int _nr,
2081 void write (ICPStep::Memory mem = ICPStep::Memory::D_IN_F,
void *ptr =
nullptr,
bool block = CL_FALSE,
2082 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
2084 void* read (ICPStep::Memory mem = ICPStep::Memory::H_IO_T,
bool block = CL_TRUE,
2085 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
2087 void buildRBC (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
2089 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr,
bool config =
false);
2095 void setAlpha (
float _a);
2097 float getScaling ();
2099 void setScaling (
float _c);
2118 Eigen::Quaternionf
q;
2134 <RBC::KernelTypeC::KINECT_R, RBC::RBCPermuteConfig::GENERIC>
rbcC;
2137 <RBC::KernelTypeC::KINECT_R,
2138 RBC::RBCPermuteConfig::GENERIC, RBC::KernelTypeS::KINECT>
rbcS;
2162 template <
typename period>
2163 double run (clutils::GPUTimer<period> &timer,
2164 const std::vector<cl::Event> *events =
nullptr,
bool config =
false)
2166 clutils::CPUTimer<double, std::milli> cTimer;
2169 pTime += transform.
run (timer, events);
2170 pTime += rbcS.run (timer,
nullptr, config);
2171 pTime += means.
run (timer);
2172 pTime += devs.
run (timer);
2173 pTime += matrixS.
run (timer);
2174 pTime += powMethod.
run (timer);
2180 qk = Eigen::Quaternionf (Tk);
2181 Rk = Eigen::Matrix3f (qk);
2182 tk = Eigen::Map<Eigen::Vector3f> (Tk + 4, 3);
2186 q = Eigen::Quaternionf (R);
2187 t = sk * Rk * t + tk;
2190 Eigen::Map<Eigen::Vector4f> (hPtrIOT, 4) = q.coeffs ();
2191 Eigen::Map<Eigen::Vector4f> (hPtrIOT + 4, 4) = t.homogeneous ();
2194 pTime += cTimer.stop ();
2196 queue.enqueueWriteBuffer (dBufferIOT, CL_FALSE, 0, bufferTSize, hPtrIOT,
nullptr, &timer.event ());
2197 queue.flush (); timer.wait ();
2198 pTime += timer.duration ();
2270 ICPStep (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _infoRBC, clutils::CLEnvInfo<1> _infoICP);
2272 cl::Memory&
get (ICPStep::Memory mem);
2274 void init (
unsigned int _m,
unsigned int _nr,
2277 void write (ICPStep::Memory mem = ICPStep::Memory::D_IN_F,
void *ptr =
nullptr,
bool block = CL_FALSE,
2278 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
2280 void* read (ICPStep::Memory mem = ICPStep::Memory::H_IO_T,
bool block = CL_TRUE,
2281 const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
2283 void buildRBC (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
2285 void run (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr,
bool config =
false);
2291 void setAlpha (
float _a);
2293 float getScaling ();
2295 void setScaling (
float _c);
2314 Eigen::Quaternionf
q;
2330 <RBC::KernelTypeC::KINECT_R, RBC::RBCPermuteConfig::GENERIC>
rbcC;
2333 <RBC::KernelTypeC::KINECT_R,
2334 RBC::RBCPermuteConfig::GENERIC, RBC::KernelTypeS::KINECT>
rbcS;
2359 template <
typename period>
2360 double run (clutils::GPUTimer<period> &timer,
2361 const std::vector<cl::Event> *events =
nullptr,
bool config =
false)
2363 clutils::CPUTimer<double, std::milli> cTimer;
2366 pTime += transform.
run (timer, events);
2367 pTime += rbcS.run (timer,
nullptr, config);
2368 pTime += weights.
run (timer);
2369 pTime += means.
run (timer);
2370 pTime += devs.
run (timer);
2371 pTime += matrixS.
run (timer);
2372 pTime += powMethod.
run (timer);
2378 qk = Eigen::Quaternionf (Tk);
2379 Rk = Eigen::Matrix3f (qk);
2380 tk = Eigen::Map<Eigen::Vector3f> (Tk + 4, 3);
2384 q = Eigen::Quaternionf (R);
2385 t = sk * Rk * t + tk;
2388 Eigen::Map<Eigen::Vector4f> (hPtrIOT, 4) = q.coeffs ();
2389 Eigen::Map<Eigen::Vector4f> (hPtrIOT + 4, 4) = t.homogeneous ();
2392 pTime += cTimer.stop ();
2394 queue.enqueueWriteBuffer (dBufferIOT, CL_FALSE, 0, bufferTSize, hPtrIOT,
nullptr, &timer.event ());
2395 queue.flush (); timer.wait ();
2396 pTime += timer.duration ();
2433 template <ICPStepConfigT CR, ICPStepConfigW CW>
2438 ICP (clutils::CLEnv &_env, clutils::CLEnvInfo<1> _infoRBC, clutils::CLEnvInfo<1> _infoICP);
2440 void init (
unsigned int _m,
unsigned int _nr,
float _a = 1e2f,
float _c = 1e-6f,
2441 unsigned int _max_iterations = 40,
double _angle_threshold = 0.001,
2444 void buildRBC (
const std::vector<cl::Event> *events =
nullptr, cl::Event *event =
nullptr);
2466 inline bool check ();
2482 template <
typename period>
2483 double run (clutils::GPUTimer<period> &timer)
2485 clutils::ProfilingInfo<40> steps (
"Steps");
2488 for (
int i = 1; i < 40; ++i)
2491 steps.print (
"ICP");
2493 return steps.total ();
2501 #endif // ICP_ALGORITHMS_HPP
cl_float * hPtrInF
Definition: algorithms.hpp:783
cl_float sk
Definition: algorithms.hpp:2309
ICPMean< ICPMeanConfig::REGULAR > means
Definition: algorithms.hpp:2139
cl::Buffer hBufferIOT
Definition: algorithms.hpp:2149
clutils::CLEnv & env
Definition: algorithms.hpp:1703
rbc_dist_id * hPtrIn
Definition: algorithms.hpp:520
cl_float * hPtrIOT
Definition: algorithms.hpp:1679
RBC::RBCSearch< RBC::KernelTypeC::KINECT_R, RBC::RBCPermuteConfig::GENERIC, RBC::KernelTypeS::KINECT > rbcS
Definition: algorithms.hpp:2334
cl_float * hPtrInW
Definition: algorithms.hpp:1145
double run(clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr, bool config=false)
Executes the necessary kernels.
Definition: algorithms.hpp:1740
RBC::RBCConstruct< RBC::KernelTypeC::KINECT_R, RBC::RBCPermuteConfig::GENERIC > rbcC
Definition: algorithms.hpp:2330
Memory
Enumerates the memory objects handled by the class.
Definition: algorithms.hpp:404
ICPWeights(clutils::CLEnv &_env, clutils::CLEnvInfo< 1 > _info)
Configures an OpenCL environment as specified by _info.
Definition: algorithms.cpp:982
ICPMean< ICPMeanConfig::WEIGHTED > means
Definition: algorithms.hpp:2336
Eigen::Vector3f mm
Definition: algorithms.hpp:1720
ICPStepConfigW
Enumerates configurations for the ICPStep class.
Definition: algorithms.hpp:1560
cl_float s
Definition: algorithms.hpp:2123
void run()
Executes the necessary kernels.
Definition: algorithms.cpp:4807
ICPStepConfigT
Enumerates configurations for the ICPStep class.
Definition: algorithms.hpp:1544
Eigen::Quaternionf qk
Definition: algorithms.hpp:1895
Eigen::Quaternionf qk
Definition: algorithms.hpp:2108
cl_float * hPtrInMean
Definition: algorithms.hpp:905
unsigned int bufferTSize
Definition: algorithms.hpp:1937
cl::Buffer hBufferIOT
Definition: algorithms.hpp:1726
cl_float * hPtrIOT
Definition: algorithms.hpp:1890
Eigen::Quaternionf q
Definition: algorithms.hpp:1905
void init(Staging _staging=Staging::IO)
Configures kernel execution parameters.
Definition: algorithms.cpp:3007
Offers functions that are serial CPU implementations of the relevant algorithms in the ICP pipeline...
Definition: helper_funcs.hpp:47
void setTranslationThreshold(double _translation_threshold)
Sets the threshold for the change in translation.
Definition: algorithms.cpp:4890
ICPTransform< ICPTransformConfig::QUATERNION > transform
Definition: algorithms.hpp:2135
Interface class for the icpComputeReduceWeights kernel.
Definition: algorithms.hpp:485
unsigned int nr
Definition: algorithms.hpp:2147
clutils::CLEnvInfo< 1 > infoRBC
Definition: algorithms.hpp:2128
void init(Staging _staging=Staging::IO)
Configures kernel execution parameters.
Definition: algorithms.cpp:659
Memory
Enumerates the memory objects handled by the class.
Definition: algorithms.hpp:319
cl_float sk
Definition: algorithms.hpp:1689
double run(clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr)
Executes the necessary kernels.
Definition: algorithms.hpp:1529
ICPS< ICPSConfig::REGULAR > matrixS
Definition: algorithms.hpp:1717
cl_float * hPtrOutW
Definition: algorithms.hpp:521
cl_float s
Definition: algorithms.hpp:1699
ReduceConfig
Enumerates configurations for the Reduce class.
Definition: algorithms.hpp:52
Eigen::Vector3f t
Definition: algorithms.hpp:2317
Staging staging
Definition: algorithms.hpp:2131
cl::Context context
Definition: algorithms.hpp:1916
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:567
cl_float * hPtrOutTk
Definition: algorithms.hpp:1506
void init(unsigned int _n, Staging _staging=Staging::IO)
Configures kernel execution parameters.
Definition: algorithms.cpp:1847
cl::Buffer dBufferIOT
Definition: algorithms.hpp:1727
RBC::RBCConstruct< RBC::KernelTypeC::KINECT_R, RBC::RBCPermuteConfig::GENERIC > rbcC
Definition: algorithms.hpp:1710
void run(const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Executes the necessary kernels.
Definition: algorithms.cpp:3146
double run(clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr)
Executes the necessary kernels.
Definition: algorithms.hpp:141
void run(const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Executes the necessary kernels.
Definition: algorithms.cpp:1780
void run(const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Executes the necessary kernels.
Definition: algorithms.cpp:591
void run(const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Executes the necessary kernels.
Definition: algorithms.cpp:2519
float c
Definition: algorithms.hpp:2343
ICPTransformConfig
Enumerates configurations for the ICPTransform class.
Definition: algorithms.hpp:1189
cl_float * hPtrInF
Definition: algorithms.hpp:2101
void * read(ICPWeights::Memory mem=ICPWeights::Memory::H_OUT_SUM_W, 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:1198
ICPTransform< ICPTransformConfig::QUATERNION > transform
Definition: algorithms.hpp:2331
cl_float s
Definition: algorithms.hpp:1910
ICPPowerMethod powMethod
Definition: algorithms.hpp:2339
Eigen::Quaternionf q
Definition: algorithms.hpp:2314
cl_float * hPtrInDevM
Definition: algorithms.hpp:1030
void * read(ICPReps::Memory mem=ICPReps::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:950
Staging staging
Definition: algorithms.hpp:2327
cl_float * hPtrInM
Definition: algorithms.hpp:1889
Interface class for the scan kernels.
Definition: algorithms.hpp:200
cl_float * hPtrInDevF
Definition: algorithms.hpp:1031
clutils::CLEnvInfo< 1 > infoRBC
Definition: algorithms.hpp:1915
Eigen::Vector3f tk
Definition: algorithms.hpp:1687
Eigen::Matrix3f R
Definition: algorithms.hpp:1903
cl_float * hPtrInS
Definition: algorithms.hpp:1504
cl_float * hPtrInM
Definition: algorithms.hpp:2298
unsigned int nr
Definition: algorithms.hpp:1936
RBC::RBCConstruct< RBC::KernelTypeC::KINECT_R, RBC::RBCPermuteConfig::GENERIC > rbcC
Definition: algorithms.hpp:1921
ICPReps fReps
Definition: algorithms.hpp:1919
Staging staging
Definition: algorithms.hpp:1918
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:258
Memory
Enumerates the memory objects handled by the class.
Definition: algorithms.hpp:1109
Eigen::Matrix3f Rk
Definition: algorithms.hpp:1893
Interface class for the getLMs kernel.
Definition: algorithms.hpp:312
ICP(clutils::CLEnv &_env, clutils::CLEnvInfo< 1 > _infoRBC, clutils::CLEnvInfo< 1 > _infoICP)
Configures an OpenCL environment as specified by _info.
Definition: algorithms.cpp:4751
RBC::RBCSearch< RBC::KernelTypeC::KINECT_R, RBC::RBCPermuteConfig::GENERIC, RBC::KernelTypeS::KINECT > rbcS
Definition: algorithms.hpp:1714
ICPWeights weights
Definition: algorithms.hpp:2335
void buildRBC(const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Builds the RBC data structure.
Definition: algorithms.cpp:4793
float c
Definition: algorithms.hpp:2146
cl_float * hPtrInM
Definition: algorithms.hpp:2102
cl::CommandQueue queue
Definition: algorithms.hpp:1706
Memory
Enumerates the memory objects handled by the class.
Definition: algorithms.hpp:1621
ICPDevs devs
Definition: algorithms.hpp:2140
Memory
Enumerates the memory objects handled by the class.
Definition: algorithms.hpp:998
void * read(ICPMean::Memory mem=ICPMean::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:1757
T * hPtrIn
Definition: algorithms.hpp:115
cl::Buffer dBufferIOT
Definition: algorithms.hpp:1939
Interface class for calculating the S matrix and the s scale factor constituents, while considering w...
Definition: algorithms.hpp:1102
void write(ICPWeights::Memory mem=ICPWeights::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:1170
double run(clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr)
Executes the necessary kernels.
Definition: algorithms.hpp:548
double run(clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr)
Executes the necessary kernels.
Definition: algorithms.hpp:451
float c
Definition: algorithms.hpp:1723
void init(unsigned int _nr, Staging _staging=Staging::IO)
Configures kernel execution parameters.
Definition: algorithms.cpp:830
Offers classes which set up kernel execution parameters and provide interfaces for the handling of me...
Definition: algorithms.hpp:45
cl::Context context
Definition: algorithms.hpp:2129
void * read(ICPMean::Memory mem=ICPMean::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:1458
ICPDevs devs
Definition: algorithms.hpp:2337
cl::Context context
Definition: algorithms.hpp:2325
cl_float * hPtrIn
Definition: algorithms.hpp:342
cl_float * hPtrOutDevM
Definition: algorithms.hpp:907
Memory
Enumerates the memory objects handled by the class.
Definition: algorithms.hpp:751
double translation_threshold
Threshold for the change in translation (in mm) in the transformation.
Definition: algorithms.hpp:2473
cl_float * Tk
Definition: algorithms.hpp:2341
cl_float * hPtrInM
Definition: algorithms.hpp:784
cl::Buffer hBufferIOT
Definition: algorithms.hpp:2346
void run(const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Executes the necessary kernels.
Definition: algorithms.cpp:1224
ICPTransform< ICPTransformConfig::QUATERNION > transform
Definition: algorithms.hpp:1711
cl::Context context
Definition: algorithms.hpp:1705
cl::CommandQueue queue
Definition: algorithms.hpp:2130
Memory
Enumerates the memory objects handled by the class.
Definition: algorithms.hpp:492
cl_float * hPtrIOT
Definition: algorithms.hpp:2299
Eigen::Quaternionf qk
Definition: algorithms.hpp:1684
Memory
Enumerates the memory objects handled by the class.
Definition: algorithms.hpp:91
Declares classes used by the OpenCL interface classes in cl_algo.
void run(const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Executes the necessary kernels.
Definition: algorithms.cpp:973
cl_float * hPtrOut
Definition: algorithms.hpp:343
cl_float sk
Definition: algorithms.hpp:1900
double run(clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr, bool config=false)
Executes the necessary kernels.
Definition: algorithms.hpp:2163
Reduce(clutils::CLEnv &_env, clutils::CLEnvInfo< 1 > _info)
Configures an OpenCL environment as specified by _info.
Eigen::Vector3f tk
Definition: algorithms.hpp:2111
void init(unsigned int _n, Staging _staging=Staging::IO)
Configures kernel execution parameters.
Definition: algorithms.cpp:1029
cl::Buffer hBufferIOT
Definition: algorithms.hpp:1938
Eigen::Matrix3f S
Definition: algorithms.hpp:1721
Memory
Enumerates the memory objects handled by the class.
Definition: algorithms.hpp:207
ICPSConfig
Enumerates configurations for the ICPS class.
Definition: algorithms.hpp:943
cl_float * hPtrInDevF
Definition: algorithms.hpp:1144
cl_double * hPtrInSW
Definition: algorithms.hpp:786
Memory
Enumerates the memory objects handled by the class.
Definition: algorithms.hpp:2045
Staging staging
Definition: algorithms.hpp:1707
T * hPtrIn
Definition: algorithms.hpp:231
ICPMean< ICPMeanConfig::REGULAR > means
Definition: algorithms.hpp:1715
Eigen::Vector3f t
Definition: algorithms.hpp:1697
double getAngleThreshold()
Gets the threshold for the change in angle.
Definition: algorithms.cpp:4858
double run(clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr, bool config=false)
Executes the necessary kernels.
Definition: algorithms.hpp:2360
Memory
Enumerates the memory objects handled by the class.
Definition: algorithms.hpp:632
void init(unsigned int _cols, unsigned int _rows, Staging _staging=Staging::IO)
Configures kernel execution parameters.
Definition: algorithms.cpp:132
ScanConfig
Enumerates configurations for the Scan class.
Definition: algorithms.hpp:169
cl_float sk
Definition: algorithms.hpp:2113
RBC::RBCConstruct< RBC::KernelTypeC::KINECT_R, RBC::RBCPermuteConfig::GENERIC > rbcC
Definition: algorithms.hpp:2134
RBC::RBCSearch< RBC::KernelTypeC::KINECT_R, RBC::RBCPermuteConfig::GENERIC, RBC::KernelTypeS::KINECT > rbcS
Definition: algorithms.hpp:2138
Eigen::Matrix3f S
Definition: algorithms.hpp:1933
clutils::CLEnvInfo< 1 > infoRBC
Definition: algorithms.hpp:2324
cl_float * hPtrIOT
Definition: algorithms.hpp:2103
T * hPtrOut
Definition: algorithms.hpp:116
void run(const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Executes the necessary kernels.
Definition: algorithms.cpp:782
ICPLMs(clutils::CLEnv &_env, clutils::CLEnvInfo< 1 > _info)
Configures an OpenCL environment as specified by _info.
Definition: algorithms.cpp:621
Interface class for calculating the S matrix and the s scale factor constituents. ...
Definition: algorithms.hpp:962
ICPMean< ICPMeanConfig::WEIGHTED > means
Definition: algorithms.hpp:1927
double run(clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr)
Executes the necessary kernels.
Definition: algorithms.hpp:1058
Staging
Enumerates staging buffer configurations.
Definition: common.hpp:43
RBC::RBCSearch< RBC::KernelTypeC::KINECT_R, RBC::RBCPermuteConfig::GENERIC, RBC::KernelTypeS::KINECT > rbcS
Definition: algorithms.hpp:1925
Eigen::Matrix3f Rk
Definition: algorithms.hpp:2106
Memory
Enumerates the memory objects handled by the class.
Definition: algorithms.hpp:874
cl_float * hPtrInMean
Definition: algorithms.hpp:1505
double run(clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr)
Executes the necessary kernels.
Definition: algorithms.hpp:366
ICPDevs devs
Definition: algorithms.hpp:1716
ICPDevs(clutils::CLEnv &_env, clutils::CLEnvInfo< 1 > _info)
Configures an OpenCL environment as specified by _info.
Definition: algorithms.cpp:1797
cl_float * Tk
Definition: algorithms.hpp:2144
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:287
ICPReps fReps
Definition: algorithms.hpp:2328
Scan(clutils::CLEnv &_env, clutils::CLEnvInfo< 1 > _info)
Configures an OpenCL environment as specified by _info.
cl::CommandQueue queue
Definition: algorithms.hpp:2326
void run(const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Executes the necessary kernels.
Definition: algorithms.cpp:2251
ICPMeanConfig
Enumerates configurations for the ICPMean class.
Definition: algorithms.hpp:576
cl_float * hPtrOut
Definition: algorithms.hpp:662
Eigen::Quaternionf q
Definition: algorithms.hpp:1694
void * read(ICPDevs::Memory mem=ICPDevs::Memory::H_OUT_DEV_F, 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:2003
unsigned int bufferTSize
Definition: algorithms.hpp:1725
Memory
Enumerates the memory objects handled by the class.
Definition: algorithms.hpp:1458
Eigen::Matrix3f R
Definition: algorithms.hpp:2312
double run(clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr)
Executes the necessary kernels.
Definition: algorithms.hpp:813
ICPS< ICPSConfig::REGULAR > matrixS
Definition: algorithms.hpp:2141
cl::Buffer dBufferIOT
Definition: algorithms.hpp:2347
void run(const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Executes the necessary kernels.
Definition: algorithms.cpp:311
void init(unsigned int _m, unsigned int _nr, float _a=1e2f, float _c=1e-6f, unsigned int _max_iterations=40, double _angle_threshold=0.001, double _translation_threshold=0.01, Staging _staging=Staging::IO)
Configures kernel execution parameters.
Definition: algorithms.cpp:4778
clutils::CLEnv & env
Definition: algorithms.hpp:1914
void run(const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Executes the necessary kernels.
Definition: algorithms.cpp:2029
Eigen::Vector3f t
Definition: algorithms.hpp:2121
cl_float * hPtrOut
Definition: algorithms.hpp:787
void write(ICPReps::Memory mem=ICPReps::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:922
clutils::CLEnv & env
Definition: algorithms.hpp:2323
cl_float * hPtrInM
Definition: algorithms.hpp:661
Interface class for the icpMean kernel.
Definition: algorithms.hpp:625
void * read(ICPLMs::Memory mem=ICPLMs::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:759
cl_float * hPtrInDevM
Definition: algorithms.hpp:1143
double run(clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr)
Executes the necessary kernels.
Definition: algorithms.hpp:1172
unsigned int getMaxIterations()
Gets the maximum number of iterations.
Definition: algorithms.cpp:4839
Memory
Enumerates the memory objects handled by the class.
Definition: algorithms.hpp:2241
cl::CommandQueue queue
Definition: algorithms.hpp:1917
cl_float * hPtrOutDevF
Definition: algorithms.hpp:906
void init(unsigned int _cols, unsigned int _rows, Staging _staging=Staging::IO)
Configures kernel execution parameters.
Definition: algorithms.cpp:403
unsigned int k
Current iteration number.
Definition: algorithms.hpp:2462
Eigen::Vector3f tk
Definition: algorithms.hpp:2307
Eigen::Matrix3f Rk
Definition: algorithms.hpp:2302
cl_float * hPtrInM
Definition: algorithms.hpp:904
Interface class for the icpTransform_Matrix kernel.
Definition: algorithms.hpp:1451
ICPWeights weights
Definition: algorithms.hpp:1926
void write(ICPPowerMethod::Memory mem=ICPPowerMethod::Memory::D_IN_S, 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:3090
Eigen::Quaternionf qk
Definition: algorithms.hpp:2304
double angle_threshold
Threshold for the change in angle (in degrees) in the transformation.
Definition: algorithms.hpp:2471
cl_float * hPtrInF
Definition: algorithms.hpp:1888
cl_float * hPtrInF
Definition: algorithms.hpp:2297
ICPS< ICPSConfig::WEIGHTED > matrixS
Definition: algorithms.hpp:2338
cl_float * hPtrIn
Definition: algorithms.hpp:427
Eigen::Matrix3f R
Definition: algorithms.hpp:2116
cl_float * hPtrInW
Definition: algorithms.hpp:785
cl_float * hPtrOut
Definition: algorithms.hpp:1146
void * read(ICPPowerMethod::Memory mem=ICPPowerMethod::Memory::H_OUT_T_K, 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:3123
cl_float * hPtrInM
Definition: algorithms.hpp:1678
unsigned int nr
Definition: algorithms.hpp:2344
ICPDevs devs
Definition: algorithms.hpp:1928
T * hPtrOut
Definition: algorithms.hpp:232
double run(clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr)
Executes the necessary kernels.
Definition: algorithms.hpp:257
ICPS< ICPSConfig::WEIGHTED > matrixS
Definition: algorithms.hpp:1929
cl_float * Sij
Definition: algorithms.hpp:1719
ICPReps(clutils::CLEnv &_env, clutils::CLEnvInfo< 1 > _info)
Configures an OpenCL environment as specified by _info.
Definition: algorithms.cpp:791
void * read(ICPS::Memory mem=ICPS::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:2496
bool check()
Performs the convergence check.
Definition: algorithms.cpp:4824
unsigned int bufferTSize
Definition: algorithms.hpp:2345
ICPPowerMethod powMethod
Definition: algorithms.hpp:2142
double run(clutils::GPUTimer< period > &timer)
Executes the necessary kernels.
Definition: algorithms.hpp:2483
Interface class for calculating the S matrix and the s scale factor constituents, while considering r...
Definition: algorithms.hpp:991
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:538
unsigned int max_iterations
Maximum number of iterations that a registration process is allowed to perform.
Definition: algorithms.hpp:2469
Eigen::Matrix3f R
Definition: algorithms.hpp:1692
void write(ICPDevs::Memory mem=ICPDevs::Memory::D_IN_F, 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:1965
ICPPowerMethod(clutils::CLEnv &_env, clutils::CLEnvInfo< 1 > _info)
Configures an OpenCL environment as specified by _info.
Definition: algorithms.cpp:2966
Memory
Enumerates the memory objects handled by the class.
Definition: algorithms.hpp:1832
Interface class for the ICP pipeline.
Definition: algorithms.hpp:1583
Eigen::Matrix3f Rk
Definition: algorithms.hpp:1682
cl_float * hPtrInF
Definition: algorithms.hpp:1677
void run(const std::vector< cl::Event > *events=nullptr, cl::Event *event=nullptr)
Executes the necessary kernels.
Definition: algorithms.cpp:1481
cl_float * hPtrInF
Definition: algorithms.hpp:660
Interface class for the reduce kernels.
Definition: algorithms.hpp:84
double getTranslationThreshold()
Gets the threshold for the change in translation.
Definition: algorithms.cpp:4878
void write(ICPLMs::Memory mem=ICPLMs::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:731
Interface class for the icpSubtractMean kernel.
Definition: algorithms.hpp:867
unsigned int bufferTSize
Definition: algorithms.hpp:2148
cl_double * hPtrOutSW
Definition: algorithms.hpp:522
Eigen::Quaternionf q
Definition: algorithms.hpp:2118
ICPTransform< ICPTransformConfig::QUATERNION > transform
Definition: algorithms.hpp:1922
Eigen::Vector3f t
Definition: algorithms.hpp:1908
ICPReps fReps
Definition: algorithms.hpp:1708
void setMaxIterations(unsigned int _max_iterations)
Sets the maximum number of iterations.
Definition: algorithms.cpp:4850
clutils::CLEnvInfo< 1 > infoRBC
Definition: algorithms.hpp:1704
double run(clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr)
Executes the necessary kernels.
Definition: algorithms.hpp:931
cl_float * hPtrOut
Definition: algorithms.hpp:1032
void setAngleThreshold(double _angle_threshold)
Sets the threshold for the change in angle.
Definition: algorithms.cpp:4870
clutils::CLEnv & env
Definition: algorithms.hpp:2127
unsigned int nr
Definition: algorithms.hpp:1724
Eigen::Vector3f mm
Definition: algorithms.hpp:1932
Interface class for the icpMean_Weighted kernel.
Definition: algorithms.hpp:744
cl_float * hPtrOut
Definition: algorithms.hpp:428
Interface class for the getReps kernel.
Definition: algorithms.hpp:397
Interface class for the calculation of the fixed and moving set means.
Definition: algorithms.hpp:596
cl_float * hPtrInF
Definition: algorithms.hpp:903
ICPReps fReps
Definition: algorithms.hpp:2132
double run(clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr)
Executes the necessary kernels.
Definition: algorithms.hpp:687
cl_float s
Definition: algorithms.hpp:2319
Eigen::Vector3f tk
Definition: algorithms.hpp:1898
cl::Buffer dBufferIOT
Definition: algorithms.hpp:2150
float c
Definition: algorithms.hpp:1935
double run(clutils::GPUTimer< period > &timer, const std::vector< cl::Event > *events=nullptr, bool config=false)
Executes the necessary kernels.
Definition: algorithms.hpp:1952
void * read(ICPS::Memory mem=ICPS::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:2228
cl_float * Sij
Definition: algorithms.hpp:1931