Loading...
Searching...
No Matches
itk::OpenCLKernelManager Class Reference

`#include <itkOpenCLKernelManager.h>`

## Detailed Description

OpenCL kernel manager implemented using OpenCL.

This class is responsible for managing the GPU kernel and command queue.

Note
  This file was taken from ITK 4.1.0. It was modified by Denis P. Shamonin and Marius Staring. Division of Image Processing, Department of Radiology, Leiden, The Netherlands. Added functionality is described in the Insight Journal paper: http://hdl.handle.net/10380/3393

Definition at line 67 of file itkOpenCLKernelManager.h.

Inheritance diagram for itk::OpenCLKernelManager:
[legend]

## Data Structures

struct | KernelArgumentList

## Public Types

using | ConstPointer = SmartPointer<const Self>
using | Pointer = SmartPointer<Self>
using | Self = OpenCLKernelManager
using | Superclass = LightObject

## Public Member Functions

OpenCLProgram | BuildProgramFromSourceCode (const std::string &sourceCode, const std::string &prefixSourceCode=std::string(), const std::string &postfixSourceCode=std::string(), const std::string &extraBuildOptions=std::string())
OpenCLProgram | BuildProgramFromSourceFile (const std::string &fileName, const std::string &prefixSourceCode=std::string(), const std::string &postfixSourceCode=std::string(), const std::string &extraBuildOptions=std::string())
std::vcl_size_t | CreateKernel (const OpenCLProgram &program, const std::string &name)
virtual const char * | GetClassName () const
OpenCLContext * | GetContext () const
OpenCLKernel & | GetKernel (const std::vcl_size_t kernelId)
| ITK_DISALLOW_COPY_AND_MOVE (OpenCLKernelManager)
OpenCLEvent | LaunchKernel (const std::vcl_size_t kernelId)
OpenCLEvent | LaunchKernel (const std::vcl_size_t kernelId, const OpenCLEventList &event_list)
OpenCLEvent | LaunchKernel (const std::vcl_size_t kernelId, const OpenCLEventList &event_list, const OpenCLSize &global_work_size, const OpenCLSize &local_work_size=OpenCLSize::null, const OpenCLSize &global_work_offset=OpenCLSize::null)
OpenCLEvent | LaunchKernel (const std::vcl_size_t kernelId, const OpenCLSize &global_work_size, const OpenCLSize &local_work_size=OpenCLSize::null, const OpenCLSize &global_work_offset=OpenCLSize::null)
void | SetGlobalWorkOffsetForAllKernels (const OpenCLSize &offset)
void | SetGlobalWorkSizeForAllKernels (const OpenCLSize &size)
bool | SetKernelArg (const std::vcl_size_t kernelId, const cl_uint argId, const std::vcl_size_t argSize, const void *argVal)
bool | SetKernelArgForAllKernels (const cl_uint argId, const std::vcl_size_t argSize, const void *argVal)
bool | SetKernelArgWithImage (const std::vcl_size_t kernelId, cl_uint argId, const GPUDataManager::Pointer manager)
void | SetLocalWorkSizeForAllKernels (const OpenCLSize &size)

## Static Public Member Functions

static Pointer | New ()

## Protected Member Functions

bool | CheckArgumentReady (const std::vcl_size_t kernelId)
| OpenCLKernelManager ()
void | ResetArguments (const std::vcl_size_t kernelIdx)
| ~OpenCLKernelManager () override

## Private Attributes

OpenCLContext * | m_Context {}
std::vector< std::vector< KernelArgumentList > > | m_KernelArgumentReady {}
std::vector< OpenCLKernel > | m_Kernels {}

## Member Typedef Documentation

## ConstPointer

using itk::OpenCLKernelManager::ConstPointer = SmartPointer<const Self>

Definition at line 76 of file itkOpenCLKernelManager.h.

## Pointer

using itk::OpenCLKernelManager::Pointer = SmartPointer<Self>

Definition at line 75 of file itkOpenCLKernelManager.h.

## Self

using itk::OpenCLKernelManager::Self = OpenCLKernelManager

Standard class typedefs.

Definition at line 73 of file itkOpenCLKernelManager.h.

## Superclass

using itk::OpenCLKernelManager::Superclass = LightObject

Definition at line 74 of file itkOpenCLKernelManager.h.

## Constructor & Destructor Documentation

## OpenCLKernelManager()

itk::OpenCLKernelManager::OpenCLKernelManager | ( |  | ) |

protected

## ~OpenCLKernelManager()

itk::OpenCLKernelManager::~OpenCLKernelManager | ( |  | ) |

override protected

## Member Function Documentation

## BuildProgramFromSourceCode()

OpenCLProgram itk::OpenCLKernelManager::BuildProgramFromSourceCode | ( | const std::string & | sourceCode,
|  | const std::string & | prefixSourceCode = std::string(),
|  | const std::string & | postfixSourceCode = std::string(),
|  | const std::string & | extraBuildOptions = std::string() )

## BuildProgramFromSourceFile()

OpenCLProgram itk::OpenCLKernelManager::BuildProgramFromSourceFile | ( | const std::string & | fileName,
|  | const std::string & | prefixSourceCode = std::string(),
|  | const std::string & | postfixSourceCode = std::string(),
|  | const std::string & | extraBuildOptions = std::string() )

## CheckArgumentReady()

bool itk::OpenCLKernelManager::CheckArgumentReady | ( | const std::vcl_size_t | kernelId | ) |

protected

## CreateKernel()

std::vcl_size_t itk::OpenCLKernelManager::CreateKernel | ( | const OpenCLProgram & | program,
|  | const std::string & | name )

## GetClassName()

virtual const char * itk::OpenCLKernelManager::GetClassName | ( |  | ) | const

virtual

Run-time type information (and related methods).

## GetContext()

OpenCLContext * itk::OpenCLKernelManager::GetContext | ( |  | ) | const

inline

Returns the OpenCL context that this kernel manager was created within.

Definition at line 86 of file itkOpenCLKernelManager.h.

## GetKernel()

OpenCLKernel & itk::OpenCLKernelManager::GetKernel | ( | const std::vcl_size_t | kernelId | ) |

Returns the .

## ITK_DISALLOW_COPY_AND_MOVE()

itk::OpenCLKernelManager::ITK_DISALLOW_COPY_AND_MOVE | ( | OpenCLKernelManager |  | ) |

## LaunchKernel() [1/4]

OpenCLEvent itk::OpenCLKernelManager::LaunchKernel | ( | const std::vcl_size_t | kernelId | ) |

## LaunchKernel() [2/4]

OpenCLEvent itk::OpenCLKernelManager::LaunchKernel | ( | const std::vcl_size_t | kernelId,
|  | const OpenCLEventList & | event_list )

## LaunchKernel() [3/4]

OpenCLEvent itk::OpenCLKernelManager::LaunchKernel | ( | const std::vcl_size_t | kernelId,
|  | const OpenCLEventList & | event_list,
|  | const OpenCLSize & | global_work_size,
|  | const OpenCLSize & | local_work_size = OpenCLSize::null,
|  | const OpenCLSize & | global_work_offset = OpenCLSize::null )

## LaunchKernel() [4/4]

OpenCLEvent itk::OpenCLKernelManager::LaunchKernel | ( | const std::vcl_size_t | kernelId,
|  | const OpenCLSize & | global_work_size,
|  | const OpenCLSize & | local_work_size = OpenCLSize::null,
|  | const OpenCLSize & | global_work_offset = OpenCLSize::null )

## New()

Pointer itk::OpenCLKernelManager::New | ( |  | ) |

static

Method for creation through the object factory.

## ResetArguments()

void itk::OpenCLKernelManager::ResetArguments | ( | const std::vcl_size_t | kernelIdx | ) |

protected

## SetGlobalWorkOffsetForAllKernels()

void itk::OpenCLKernelManager::SetGlobalWorkOffsetForAllKernels | ( | const OpenCLSize & | offset | ) |

Sets the offset for all instances of the kernels to offset.

See also
  SetGlobalWorkSizeForAllKernels(), SetLocalWorkSizeForAllKernels()

## SetGlobalWorkSizeForAllKernels()

void itk::OpenCLKernelManager::SetGlobalWorkSizeForAllKernels | ( | const OpenCLSize & | size | ) |

Sets the global work size for all instances of the kernels to size.

See also
  SetLocalWorkSizeForAllKernels(), SetGlobalWorkOffsetForAllKernels()

## SetKernelArg()

bool itk::OpenCLKernelManager::SetKernelArg | ( | const std::vcl_size_t | kernelId,
|  | const cl_uint | argId,
|  | const std::vcl_size_t | argSize,
|  | const void * | argVal )

## SetKernelArgForAllKernels()

bool itk::OpenCLKernelManager::SetKernelArgForAllKernels | ( | const cl_uint | argId,
|  | const std::vcl_size_t | argSize,
|  | const void * | argVal )

## SetKernelArgWithImage()

bool itk::OpenCLKernelManager::SetKernelArgWithImage | ( | const std::vcl_size_t | kernelId,
|  | cl_uint | argId,
|  | const GPUDataManager::Pointer | manager )

## SetLocalWorkSizeForAllKernels()

void itk::OpenCLKernelManager::SetLocalWorkSizeForAllKernels | ( | const OpenCLSize & | size | ) |

Sets the local work size for all instances of the kernels to size.

See also
  SetGlobalWorkSizeForAllKernels(), SetGlobalWorkOffsetForAllKernels()

## Field Documentation

## m_Context

OpenCLContext* itk::OpenCLKernelManager::m_Context {}

private

Definition at line 164 of file itkOpenCLKernelManager.h.

## m_KernelArgumentReady

std::vector<std::vector<KernelArgumentList> > itk::OpenCLKernelManager::m_KernelArgumentReady {}

private

Definition at line 173 of file itkOpenCLKernelManager.h.

## m_Kernels

std::vector<OpenCLKernel> itk::OpenCLKernelManager::m_Kernels {}

private

Definition at line 172 of file itkOpenCLKernelManager.h.

Generated on 1768596610 for elastix by 1.15.0 |