go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes
itk::OpenCLSize Class Reference

#include <itkOpenCLSize.h>

Detailed Description

The OpenCLSize class defines the size of an item of work for an OpenCL kernel.

OpenCL sizes may be single-dimensional, two-dimensional, or three-dimensional:

OpenCLSize one(128);
OpenCLSize two(16, 16);
OpenCLSize three(32, 32, 16);
OpenCLKernel kernel = program.CreateKernel( "test" );
kernel.SetGlobalWorkSize(one);
kernel.SetGlobalWorkSize(two);
kernel.SetGlobalWorkSize(three);
The OpenCLKernel class represents an executable entry point function in an OpenCL program.
void SetGlobalWorkSize(const OpenCLSize &size)
The OpenCLSize class defines the size of an item of work for an OpenCL kernel.
Definition: itkOpenCLSize.h:50
See also
OpenCLKernel

Definition at line 49 of file itkOpenCLSize.h.

Data Structures

struct  Null
 

Public Types

typedef OpenCLSize Self
 
typedef Size< 1 > SizeType1D
 
typedef Size< 2 > SizeType2D
 
typedef Size< 3 > SizeType3D
 

Public Member Functions

std::vcl_size_t GetDepth () const
 
cl_uint GetDimension () const
 
std::vcl_size_t GetHeight () const
 
const std::vcl_size_t * GetSizes () const
 
std::vcl_size_t GetWidth () const
 
bool IsNull () const
 
bool IsZero () const
 
 OpenCLSize ()
 
 OpenCLSize (const Null &)
 
 OpenCLSize (const SizeType1D &size)
 
 OpenCLSize (const SizeType2D &size)
 
 OpenCLSize (const SizeType3D &size)
 
 OpenCLSize (const std::vcl_size_t size)
 
 OpenCLSize (const std::vcl_size_t width, const std::vcl_size_t height)
 
 OpenCLSize (const std::vcl_size_t width, const std::vcl_size_t height, const std::vcl_size_t depth)
 
OpenCLSizeoperator= (const Null &)
 
std::vcl_size_t & operator[] (const std::vcl_size_t dim)
 
std::vcl_size_t operator[] (const std::vcl_size_t dim) const
 
OpenCLSize RoundTo (const OpenCLSize &size) const
 

Static Public Member Functions

static OpenCLSize GetLocalWorkSize (const OpenCLDevice &device)
 
static OpenCLSize GetLocalWorkSize (const OpenCLSize &maxWorkItemSize, const std::vcl_size_t maxItemsPerGroup)
 

Static Public Attributes

static const Null null
 

Private Attributes

cl_uint m_Dim
 
std::vcl_size_t m_Sizes [3]
 

Member Typedef Documentation

◆ Self

Standard class typedefs.

Definition at line 54 of file itkOpenCLSize.h.

◆ SizeType1D

typedef Size< 1 > itk::OpenCLSize::SizeType1D

Definition at line 56 of file itkOpenCLSize.h.

◆ SizeType2D

typedef Size< 2 > itk::OpenCLSize::SizeType2D

Definition at line 57 of file itkOpenCLSize.h.

◆ SizeType3D

typedef Size< 3 > itk::OpenCLSize::SizeType3D

Definition at line 58 of file itkOpenCLSize.h.

Constructor & Destructor Documentation

◆ OpenCLSize() [1/8]

itk::OpenCLSize::OpenCLSize ( const Null )
inline

Definition at line 63 of file itkOpenCLSize.h.

◆ OpenCLSize() [2/8]

itk::OpenCLSize::OpenCLSize ( )
inline

Constructs a default size consisting of a single dimension with width set to 1.

Definition at line 72 of file itkOpenCLSize.h.

◆ OpenCLSize() [3/8]

itk::OpenCLSize::OpenCLSize ( const std::vcl_size_t  size)
inline

Constructs a single-dimensional size with width set to size. The height and depth will be set to 1.

Definition at line 78 of file itkOpenCLSize.h.

◆ OpenCLSize() [4/8]

itk::OpenCLSize::OpenCLSize ( const std::vcl_size_t  width,
const std::vcl_size_t  height 
)
inline

Constructs a two-dimensional size of width, height. The depth will be set to 1.

Definition at line 84 of file itkOpenCLSize.h.

◆ OpenCLSize() [5/8]

itk::OpenCLSize::OpenCLSize ( const std::vcl_size_t  width,
const std::vcl_size_t  height,
const std::vcl_size_t  depth 
)
inline

Constructs a three-dimensional size of width, height and depth.

Definition at line 89 of file itkOpenCLSize.h.

◆ OpenCLSize() [6/8]

itk::OpenCLSize::OpenCLSize ( const SizeType1D size)
inline

Constructs a single-dimensional size from one dimention itk::Size. The height and depth will be set to 1.

See also
itk::Size

Definition at line 96 of file itkOpenCLSize.h.

◆ OpenCLSize() [7/8]

itk::OpenCLSize::OpenCLSize ( const SizeType2D size)
inline

Constructs a two-dimensional size from two-dimention itk::Size. The depth will be set to 1.

See also
itk::Size

Definition at line 103 of file itkOpenCLSize.h.

◆ OpenCLSize() [8/8]

itk::OpenCLSize::OpenCLSize ( const SizeType3D size)
inline

Constructs a three-dimensional size from three-dimention itk::Size.

See also
itk::Size

Definition at line 109 of file itkOpenCLSize.h.

Member Function Documentation

◆ GetDepth()

std::vcl_size_t itk::OpenCLSize::GetDepth ( ) const
inline

Returns the depth of this size.

Definition at line 123 of file itkOpenCLSize.h.

◆ GetDimension()

cl_uint itk::OpenCLSize::GetDimension ( ) const
inline

Returns the dimension for this size, 1, 2, or 3.

Definition at line 114 of file itkOpenCLSize.h.

◆ GetHeight()

std::vcl_size_t itk::OpenCLSize::GetHeight ( ) const
inline

Returns the height of this size.

Definition at line 120 of file itkOpenCLSize.h.

◆ GetLocalWorkSize() [1/2]

static OpenCLSize itk::OpenCLSize::GetLocalWorkSize ( const OpenCLDevice device)
static

Returns the best-fit local work size that evenly divides this work size and fits within the maximum work group size of device. This function is typically used to convert an arbitrary global work size on a OpenCLKernel into a compatible local work size.

◆ GetLocalWorkSize() [2/2]

static OpenCLSize itk::OpenCLSize::GetLocalWorkSize ( const OpenCLSize maxWorkItemSize,
const std::vcl_size_t  maxItemsPerGroup 
)
static

Returns the best-fit local work size that evenly divides this work size and fits within the maximums defined by maxWorkItemSize and maxItemsPerGroup. This function is typically used to convert an arbitrary global work size on a OpenCLKernel into a compatible local work size.

◆ GetSizes()

const std::vcl_size_t * itk::OpenCLSize::GetSizes ( ) const
inline

Returns a const pointer to the size array within this object.

Definition at line 126 of file itkOpenCLSize.h.

◆ GetWidth()

std::vcl_size_t itk::OpenCLSize::GetWidth ( ) const
inline

Returns the width of this size.

Definition at line 117 of file itkOpenCLSize.h.

◆ IsNull()

bool itk::OpenCLSize::IsNull ( ) const
inline

Definition at line 68 of file itkOpenCLSize.h.

◆ IsZero()

bool itk::OpenCLSize::IsZero ( ) const

Returns true if the elements are zero, otherwise returns false.

◆ operator=()

OpenCLSize & itk::OpenCLSize::operator= ( const Null )
inline

Definition at line 67 of file itkOpenCLSize.h.

◆ operator[]() [1/2]

std::vcl_size_t & itk::OpenCLSize::operator[] ( const std::vcl_size_t  dim)
inline

Access an element of the size. Elements are numbered 0, ..., Dim-1. No bounds checking is performed.

Definition at line 133 of file itkOpenCLSize.h.

◆ operator[]() [2/2]

std::vcl_size_t itk::OpenCLSize::operator[] ( const std::vcl_size_t  dim) const
inline

Access an element of the size. Elements are numbered 0, ..., Dim-1. This version can only be an rvalue. No bounds checking is performed.

Definition at line 139 of file itkOpenCLSize.h.

◆ RoundTo()

OpenCLSize itk::OpenCLSize::RoundTo ( const OpenCLSize size) const

Returns the result of rounding this work size up to a multiple of size.

Field Documentation

◆ m_Dim

cl_uint itk::OpenCLSize::m_Dim
private

Definition at line 161 of file itkOpenCLSize.h.

◆ m_Sizes

std::vcl_size_t itk::OpenCLSize::m_Sizes[3]
private

Definition at line 162 of file itkOpenCLSize.h.

◆ null

const Null itk::OpenCLSize::null
static

Definition at line 62 of file itkOpenCLSize.h.



Generated on 1667476801 for elastix by doxygen 1.9.4 elastix logo