11 #ifndef __CE_ArrayView__
12 #define __CE_ArrayView__
48 bool isEmpty()
const {
return mySize == 0; }
69 int src_tuplesize = 1,
int dst_tuplesize = 1,
71 exint nelements = -1,
T default_value = 0);
76 template <
typename V,
typename I>
79 int src_tuplesize = 1,
int dst_tuplesize = 1,
99 T readValue(
int idx)
const;
102 void writeValue(
int idx,
const T &
val,
bool blocking=
true);
109 void sort(
bool is_descending =
false,
int maxbits = 0)
113 sortInternal(emptyvals, is_descending, maxbits);
117 template <
typename V>
121 sortInternal(vals, is_descending, maxbits);
129 reduce_t min(
int tuplesize = 1,
int comp = 0)
const;
130 reduce_t minAbs(
int tuplesize = 1,
int comp = 0)
const;
131 reduce_t minLength(
int tuplesize = 1)
const;
132 reduce_t max(
int tuplesize = 1,
int comp = 0)
const;
133 reduce_t maxAbs(
int tuplesize = 1,
int comp = 0)
const;
134 reduce_t maxLength(
int tuplesize = 1)
const;
135 reduce_t sum(
int tuplesize = 1,
int comp = 0)
const;
136 reduce_t sumAbs(
int tuplesize = 1,
int comp = 0)
const;
137 reduce_t sumSqr(
int tuplesize = 1,
int comp = 0)
const;
143 return fsum / tuplecount;
156 void constant(
T cval);
159 template <
typename I>
167 cl::Kernel loadKernel(
const char *kernel_name,
168 const char *opt = NULL)
const;
171 int tuplesize = 1,
int comp = 0)
const;
173 template <
typename V>
175 const char *reduce_flags)
const;
178 template <
typename V>
179 void sortInternal(
CE_ArrayView<V> &vals,
bool is_descending,
int maxbits);
182 template <
typename V>
187 std::is_same_v<T, fpreal16>,
192 template <
typename V>
195 template <
typename V>
fpreal64 rms(int tuplesize=1, int comp=0) const
A simple OpenCL-based array class.
GLsizei GLenum const void * indices
CE_EXTERN_TEMPLATE(CE_ArrayView< uint8 >)
void sortValues(CE_ArrayView< V > &vals, bool is_descending=false, int maxbits=0)
Sort the array and the values.
typename std::conditional< B, T, F >::type conditional_t
GLsizei const GLfloat * value
const cl::Buffer & buffer() const
GLboolean GLboolean GLboolean GLboolean a
T prefixSum(std::vector< T > &vec, bool threaded=true, OpT op=OpT())
Computes inclusive prefix sum of a vector.
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
typename std::conditional< std::is_integral< T >::value, exint, fpreal64 >::type reduce_t
const cl::Buffer myBuffer
exint size() const
Returns the number of elements in the array.
fpreal64 dot(const CE_VectorT< T > &a, const CE_VectorT< T > &b)
typename std::conditional_t< std::is_same_v< T, fpreal16 >, fpreal32, T > scalar_arg_t
GLdouble GLdouble GLint GLint order
GLboolean GLboolean GLboolean b
CE_ScanOp
CE_Array prefix sum operators.
scalar_arg_t scalarKernelArg(T v)
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
Kernel functor interface.
Kernel interface that implements cl_kernel.
fpreal64 average(int tuplesize=1, int comp=0) const
void sort(bool is_descending=false, int maxbits=0)
Sort the array.