92 void size(
int xres,
int yres,
int zres,
93 int xghost = 1,
int yghost = 1,
int zghost = 1,
94 int xpad = 1,
int ypad = 1,
int zpad = 1);
100 int getRes(
int dim)
const {
return myRes[dim]; }
113 return myGhostCells[0] +
114 myGhostCells[1] * myStrides[1] +
115 myGhostCells[2] * myStrides[2];
119 int getGhostOffset()
const;
128 void setBorderScale(
fpreal32 scalex,
132 {
return myBorderScale[axis]; }
140 void updateBorderCells()
const;
144 {
return ((
int64)myRes[0]) * myRes[1] * myRes[2]; }
150 return (
int64)(myRes[0] + 2 * myGhostCells[0] + myPadding[0]) *
151 (
int64)(myRes[1] + 2 * myGhostCells[1] + myPadding[1]) *
152 (
int64)(myRes[2] + 2 * myGhostCells[2] + myPadding[2]);
158 {
return sizeof(
fpreal32) * numTotalVoxels(); }
164 int xghost = 1,
int yghost = 1,
int zghost = 1,
165 int xpad = 1,
int ypad = 1,
int zpad = 1);
171 bool includeGhostCells =
false)
const;
174 void match(
const CE_Grid &src);
178 bool isMatching(
const CE_Grid &src)
const;
181 bool isCongruent(
const CE_Grid& src)
const;
191 int getGhostStride(
int axis)
const;
196 return (myRes[axis] == 1);
206 return (axis2d > 0) ? 0 : 1;
213 return (axis2d < 2) ? 2 : 1;
217 int getXStride2D(
int axis2d)
const {
return myStrides[getXAxis2D(axis2d)];}
218 int getYStride2D(
int axis2d)
const {
return myStrides[getYAxis2D(axis2d)];}
226 return getXStride2D(myAxis2d);
235 return getYStride2D(myAxis2d);
252 return myRes[getXAxis2D(myAxis2d)];
261 return myRes[getYAxis2D(myAxis2d)];
281 bool isConstant(
fpreal32 *cval = 0,
bool checkBorders =
false)
const;
285 void copyData(
const CE_Grid &src);
291 void stealBuffer(
CE_Grid &src);
311 myRes[getYAxis2D(axis2d)]);
318 return (myAxis2d == -1) ? getGlobalRange() :
319 getGlobalRange2D(myAxis2d);
325 {
return getLocalRange(getGlobalRange2D3D()); }
335 const char *kernelname)
const;
342 const char *kernelname)
const;
348 const char *kernelname)
const;
427 void releaseBuffer();
435 size_t &accumsize)
const;
437 size_t accumsize,
const char *reduceFlags)
const;
440 fpreal64 doReduce(
const char* reduceFlags)
const;
441 bool doLocalReduce(
const char * options,
UT_Vector3I &radius );
int getYStride2D(int axis2d) const
int64 numVoxels() const
Returns the number of data voxels in the grid.
cl::NDRange getGlobalRange2D3D() const
UT_VoxelBorderType myBorderType
int getRes(int dim) const
GLdouble GLdouble GLdouble z
int getXStride2D3D() const
UT_Vector3I getGhostRes() const
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
__hostdev__ void setValue(uint32_t offset, bool v)
int getStride(int dim) const
int getYStride2D3D() const
int64 totalVoxelMemory() const
GA_API const UT_StringHolder scale
UT_Vector3F myBorderScale
fpreal32 getBorderScale(int axis) const
UT_VoxelBorderType getBorder() const
OIIO_FORCEINLINE const vint4 & operator+=(vint4 &a, const vint4 &b)
cl::NDRange getGlobalRange2D(int axis2d) const
int64 numTotalVoxels() const
bool isAxis2D(int axis) const
Returns whether the specified axis is 2-dimensional.
int getXStride2D(int axis2d) const
2D strides.
int getGhostRes(int dim) const
UT_Vector3I getStrides() const
static int getXAxis2D(int axis2d)
cl::NDRange getLocalRange2D3D() const
bool hasBuffer() const
If the current OpenCL buffer is valid.
int getZRes2D3D() const
Returns the true z resolution if the grid is 3D, or 1 if 2D.
LeafData & operator=(const LeafData &)=delete
UT_Vector3I getPadding() const
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
Kernel functor interface.
fpreal32 getBorderValue() const
int getAxis2D() const
Returns the 2-dimensional axis of this grid, or -1 if there is none.
static int getYAxis2D(int axis2d)
int getZStride2D3D() const
Returns the true Z-stride if the grid is 3D, or 0 if 2D.
Kernel interface that implements cl_kernel.
int getPadding(int dim) const
UT_Vector3I getRes() const
Program interface that implements cl_program.
const cl::Buffer & buffer() const
cl::NDRange getGlobalRange() const