Loading...
Searching...
No Matches
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);
itk::OpenCLKernel
The OpenCLKernel class represents an executable entry point function in an OpenCL program.
Definition itkOpenCLKernel.h:136
itk::OpenCLKernel::SetGlobalWorkSize
void SetGlobalWorkSize(const OpenCLSize &size)
itk::OpenCLSize::OpenCLSize
OpenCLSize(const Null &)
Definition itkOpenCLSize.h:63

See also
  OpenCLKernel

Definition at line 49 of file itkOpenCLSize.h.

## Data Structures

struct | Null

## Public Types

using | Self = OpenCLSize
using | SizeType1D = Size<1>
using | SizeType2D = Size<2>
using | SizeType3D = Size<3>

## 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)
OpenCLSize & | operator= (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

using itk::OpenCLSize::Self = OpenCLSize

Standard class typedefs.

Definition at line 53 of file itkOpenCLSize.h.

## SizeType1D

using itk::OpenCLSize::SizeType1D = Size<1>

Definition at line 55 of file itkOpenCLSize.h.

## SizeType2D

using itk::OpenCLSize::SizeType2D = Size<2>

Definition at line 56 of file itkOpenCLSize.h.

## SizeType3D

using itk::OpenCLSize::SizeType3D = Size<3>

Definition at line 57 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 85 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 95 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 105 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 114 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 125 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 136 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 146 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 177 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 156 of file itkOpenCLSize.h.

## GetHeight()

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

inline

Returns the height of this size.

Definition at line 170 of file itkOpenCLSize.h.

## GetLocalWorkSize() [1/2]

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]

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 184 of file itkOpenCLSize.h.

## GetWidth()

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

inline

Returns the width of this size.

Definition at line 163 of file itkOpenCLSize.h.

## IsNull()

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

inline

Definition at line 78 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 72 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 195 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 200 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 222 of file itkOpenCLSize.h.

## m_Sizes

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

private

Definition at line 223 of file itkOpenCLSize.h.

## null

const Null itk::OpenCLSize::null

static

Definition at line 62 of file itkOpenCLSize.h.

Generated on 1768596610 for elastix by 1.15.0 |