40 #include <initializer_list>
44 #include <pvsutil/Assert.h>
46 #include "SkelCL/detail/Device.h"
48 #include "SkelCL/detail/Significances.h"
54 Significances::Significances(
size_t deviceCount)
55 : _values(deviceCount)
57 const value_type one = 1.0;
58 auto amount = one / deviceCount;
60 for(
auto& value : _values) {
64 _values[deviceCount-1] += rest;
66 #ifndef NDEBUG // in debug build only (to prevent unused variable warning)
67 const value_type zero = 0.0;
68 const value_type epsilon =
static_cast<value_type
>(1.0e-10);
69 ASSERT( std::accumulate( _values.cbegin(), _values.cend(), zero )
74 Significances::Significances(std::initializer_list<value_type> significances)
75 : _values( significances.begin(), significances.end() )
77 #ifndef NDEBUG // in debug build only (to prevent unused variable warning)
78 const value_type zero = 0.0;
79 const value_type one = 1.0;
80 const value_type epsilon =
static_cast<value_type
>(1.0e-10);
81 ASSERT( std::accumulate( _values.cbegin(), _values.cend(), zero )
86 bool Significances::operator==(
const Significances& rhs)
const
88 return _values == rhs._values;
91 void Significances::setSignificances(std::initializer_list<value_type>
94 _values.assign( significances.begin(), significances.end() );
95 #ifndef NDEBUG // in debug build only (to prevent unused variable warning)
96 const value_type zero = 0.0;
97 const value_type one = 1.0;
98 const value_type epsilon =
static_cast<value_type
>(1.0e-10);
99 ASSERT( std::accumulate( _values.cbegin(), _values.cend(), zero )
104 Significances::value_type
105 Significances::getSignificance(
const Device::id_type
device)
const
110 size_t Significances::size()
const
112 return _values.size();
SKELCL_DLL detail::DeviceID device(size_t dID)
Creates an OpenCL device ID to be used as parameter of the init(detail::PlatformID, detail::DeviceID) function.