87 bool isValid()
const {
return hasBuffer(); }
91 if (isValid())
return totalVoxelMemory();
97 void size(
int xres,
int yres,
int zres,
98 int xghost = 1,
int yghost = 1,
int zghost = 1,
99 int xpad = 1,
int ypad = 1,
int zpad = 1);
105 int getRes(
int dim)
const {
return myRes[dim]; }
118 return myGhostCells[0] +
119 myGhostCells[1] * myStrides[1] +
120 myGhostCells[2] * myStrides[2];
124 int getGhostOffset()
const;
133 void setBorderScale(
fpreal32 scalex,
137 {
return myBorderScale[axis]; }
145 void updateBorderCells()
const;
149 {
return ((
int64)myRes[0]) * myRes[1] * myRes[2]; }
155 return (
int64)(myRes[0] + 2 * myGhostCells[0] + myPadding[0]) *
156 (
int64)(myRes[1] + 2 * myGhostCells[1] + myPadding[1]) *
157 (
int64)(myRes[2] + 2 * myGhostCells[2] + myPadding[2]);
163 {
return sizeof(
fpreal32) * numTotalVoxels(); }
169 int xghost = 1,
int yghost = 1,
int zghost = 1,
170 int xpad = 1,
int ypad = 1,
int zpad = 1);
176 bool include_ghost_cells =
false)
const;
179 void match(
const CE_Grid &src);
183 bool isMatching(
const CE_Grid &src)
const;
186 bool isCongruent(
const CE_Grid& src)
const;
196 int getGhostStride(
int axis)
const;
201 return (myRes[axis] == 1);
211 return (axis2d > 0) ? 0 : 1;
218 return (axis2d < 2) ? 2 : 1;
222 int getXStride2D(
int axis2d)
const {
return myStrides[getXAxis2D(axis2d)];}
223 int getYStride2D(
int axis2d)
const {
return myStrides[getYAxis2D(axis2d)];}
231 return getXStride2D(myAxis2d);
240 return getYStride2D(myAxis2d);
257 return myRes[getXAxis2D(myAxis2d)];
266 return myRes[getYAxis2D(myAxis2d)];
286 bool isConstant(
fpreal32 *cval = 0,
bool check_borders =
false)
const;
290 void copyData(
const CE_Grid &src);
296 void stealBuffer(
CE_Grid &src);
316 myRes[getYAxis2D(axis2d)]);
323 return (myAxis2d == -1) ? getGlobalRange() :
324 getGlobalRange2D(myAxis2d);
330 {
return getLocalRange(getGlobalRange2D3D()); }
340 const char *kernelname)
const;
347 const char *kernelname)
const;
353 const char *kernelname)
const;
432 void releaseBuffer();
440 size_t &accumsize)
const;
442 size_t accumsize,
const char *reduce_flags)
const;
445 fpreal64 doReduce(
const char* reduce_flags)
const;
446 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
GLint GLint GLsizei GLint GLenum GLenum type
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
exint getDeviceMemoryUsage() 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