MCPcopy Create free account
hub / github.com/boostorg/compute / operator~

Method operator~

include/boost/compute/container/valarray.hpp:127–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125 }
126
127 valarray<T> operator~() const
128 {
129 BOOST_STATIC_ASSERT_MSG(
130 is_fundamental<T>::value &&
131 !is_floating_point<typename scalar_type<T>::type>::value,
132 "This operator can be used with all OpenCL built-in scalar"
133 " and vector types except the built-in scalar and vector float types"
134 );
135 valarray<T> result(size());
136 BOOST_COMPUTE_FUNCTION(T, bitwise_not, (T x),
137 {
138 return ~x;
139 });
140 transform(begin(), end(), result.begin(), bitwise_not);
141 return result;
142 }
143
144 /// In OpenCL there cannot be memory buffer with bool type, for
145 /// this reason return type is valarray<char> instead of valarray<bool>.

Callers

nothing calls this directly

Calls 3

transformFunction · 0.85
BOOST_COMPUTE_FUNCTIONFunction · 0.50
beginMethod · 0.45

Tested by

no test coverage detected