18 #if !defined( BOLT_CL_FUNCTIONAL_H )
19 #define BOLT_CL_FUNCTIONAL_H
34 template< typename T >
37 T operator() (
const T& x)
const {
return x * x; }
42 template< typename T >
45 T operator() (
const T& x)
const {
return x * x * x; }
50 template< typename T >
53 T operator()(
const T& x)
const {
return -x;}
65 T operator()(
const T &lhs,
const T &rhs)
const {
return lhs + rhs;}
73 T operator()(
const T &lhs,
const T &rhs)
const {
return lhs - rhs;}
81 T operator()(
const T &lhs,
const T &rhs)
const {
return lhs * rhs;}
89 T operator()(
const T &lhs,
const T &rhs)
const {
return lhs / rhs;}
97 T operator()(
const T &lhs,
const T &rhs)
const {
return lhs % rhs;}
105 T operator()(
const T &lhs,
const T &rhs)
const {
return (lhs > rhs) ? lhs:rhs;}
113 T operator()(
const T &lhs,
const T &rhs)
const {
return (lhs < rhs) ? lhs:rhs;}
121 T operator()(
const T &lhs,
const T &rhs)
const {
return lhs & rhs;}
129 T operator()(
const T &lhs,
const T &rhs)
const {
return lhs | rhs;}
137 T operator()(
const T &lhs,
const T &rhs)
const {
return lhs ^ rhs;}
150 bool operator()(
const T &x)
const {
return !x;}
158 T operator()(
const T &x)
const {
return x;}
171 bool operator()(
const T &lhs,
const T &rhs)
const {
return lhs == rhs;}
179 bool operator()(
const T &lhs,
const T &rhs)
const {
return lhs != rhs;}
187 bool operator()(
const T &lhs,
const T &rhs)
const {
return lhs > rhs;}
195 bool operator()(
const T &lhs,
const T &rhs)
const {
return lhs < rhs;}
203 bool operator()(
const T &lhs,
const T &rhs)
const {
return lhs >= rhs;}
211 bool operator()(
const T &lhs,
const T &rhs)
const {
return lhs <= rhs;}
219 bool operator()(
const T &lhs,
const T &rhs)
const {
return lhs && rhs;}
227 bool operator()(
const T &lhs,
const T &rhs)
const {
return lhs || rhs;}
284 BOLT_CREATE_CLCODE( bolt::cl::not_equal_to< cl_int >, bolt::cl::not_equal_toFunctor );
293 BOLT_CREATE_CLCODE( bolt::cl::greater_equal< cl_int >, bolt::cl::greater_equalFunctor );