Go to the documentation of this file.
18 #ifndef __itkOpenCLContext_h
19 #define __itkOpenCLContext_h
21 #include "itkLightObject.h"
22 #include "itkObjectFactory.h"
73 class OpenCLVectorBase;
74 class OpenCLContextPimpl;
117 DevelopmentSingleMaximumFlopsDevice = 0x0001,
118 DevelopmentMultipleMaximumFlopsDevices = 0x0002,
119 SingleMaximumFlopsDevice = 0x0004,
120 MultipleMaximumFlopsDevices = 0x0008
142 bool Create(
const std::list< OpenCLDevice > & devices );
217 const int lineNumber = 0,
const char * location =
"" );
260 const std::size_t size );
290 template<
typename T >
292 const std::size_t size )
332 const std::string & prefixSourceCode = std::string(),
333 const std::string & postfixSourceCode = std::string() );
339 const std::string & prefixSourceCode = std::string(),
340 const std::string & postfixSourceCode = std::string() );
347 const std::size_t size );
354 const std::string & prefixSourceCode = std::string(),
355 const std::string & postfixSourceCode = std::string() );
358 const std::string & sourceCode,
359 const std::string & prefixSourceCode = std::string(),
360 const std::string & postfixSourceCode = std::string(),
361 const std::string & extraBuildOptions = std::string() );
368 const std::string & prefixSourceCode = std::string(),
369 const std::string & postfixSourceCode = std::string() );
372 const std::string & fileName,
373 const std::string & prefixSourceCode = std::string(),
374 const std::string & postfixSourceCode = std::string(),
375 const std::string & extraBuildOptions = std::string() );
452 const bool releaseEvent =
false );
462 const std::string & source,
463 const std::size_t sourceSize );
472 std::auto_ptr< OpenCLContextPimpl > d_ptr;
476 cl_command_queue GetActiveQueue();
481 OpenCLContextPimpl * d );
487 OpenCLContextPimpl * d );
491 void SetUpProfiling();
495 void OpenCLDebug( const std::
string & callname );
OpenCLImage CreateImageCopy(const OpenCLImageFormat &format, const void *data, const OpenCLSize &size, const OpenCLMemoryObject::Access access)
std::list< OpenCLDevice > GetDevices() const
The OpenCLDevice class represents the collection of OpenCL devices to be used by the host.
The base class for the OpenCLVector implementation.
cl_int Barrier(const OpenCLEventList &event_list)
OpenCLImage CreateImageDevice(const OpenCLImageFormat &format, const OpenCLMemoryObject::Access access, const OpenCLSize &size)
cl_int Marker(const OpenCLEventList &event_list)
OpenCLDevice GetDefaultDevice() const
OpenCLEvent BarrierAsync(const OpenCLEventList &event_list)
The OpenCLCommandQueue class represents an OpenCL a command-queue on a specific device and valid Open...
bool Create(const OpenCLDevice::DeviceType type)
The OpenCLMemoryObject class represents all common memory objects such as buffers and image objects.
void OpenCLProfile(cl_event clEvent, const std::string &message, const bool releaseEvent=false)
The OpenCLProgram class represents an OpenCL program object.
cl_int GetLastError() const
bool Create(const OpenCLContext::CreateMethod method)
void ReportError(const cl_int code, const char *fileName="", const int lineNumber=0, const char *location="")
OpenCLEvent MarkerAsync(const OpenCLEventList &event_list)
cl_context GetContextId() const
OpenCLBuffer CreateBufferHost(void *data, const OpenCLMemoryObject::Access access, const std::vcl_size_t size)
OpenCLProgram CreateProgramFromSourceFile(const std::string &filename, const std::string &prefixSourceCode=std::string(), const std::string &postfixSourceCode=std::string())
OpenCLVector< T > CreateVector(const OpenCLMemoryObject::Access access, const std::vcl_size_t size)
bool Create(const std::list< OpenCLDevice > &devices)
void SetCommandQueue(const OpenCLCommandQueue &queue)
OpenCLProgram BuildProgramFromSourceFile(const std::list< OpenCLDevice > &devices, const std::string &fileName, const std::string &prefixSourceCode=std::string(), const std::string &postfixSourceCode=std::string(), const std::string &extraBuildOptions=std::string())
static void SetInstance(OpenCLContext *instance)
OpenCLEvent class represents an OpenCL event object.
OpenCLContext(const Self &other)
The OpenCLKernel class represents an executable entry point function in an OpenCL program.
const Self & operator=(const Self &)
OpenCLProgram BuildProgramFromSourceFile(const std::string &fileName, const std::string &prefixSourceCode=std::string(), const std::string &postfixSourceCode=std::string())
The OpenCLSampler class represents an OpenCL sampler object.
std::list< OpenCLImageFormat > GetSupportedImageFormats(const OpenCLImageFormat::ImageType image_type, const cl_mem_flags flags) const
OpenCLImage CreateImageHost(const OpenCLImageFormat &format, void *data, const OpenCLSize &size, const OpenCLMemoryObject::Access access)
OpenCLEventList class represents a list of OpenCLEvent objects.
OpenCLProgram CreateProgramFromSourceCode(const std::string &sourceCode, const std::string &prefixSourceCode=std::string(), const std::string &postfixSourceCode=std::string())
The OpenCLUserEvent class represents OpenCL user events.
OpenCLUserEvent CreateUserEvent()
OpenCLProgram CreateOpenCLProgram(const std::string &filename, const std::string &source, const std::vcl_size_t sourceSize)
OpenCLProgram CreateProgramFromBinaryCode(const unsigned char *binary, const std::vcl_size_t size)
static cl_int WaitForFinished(const OpenCLEventList &event_list)
The OpenCLSize class defines the size of an item of work for an OpenCL kernel.
void SetDefaultDevice(const OpenCLDevice &device)
OpenCLProgram BuildProgramFromSourceCode(const std::string &sourceCode, const std::string &prefixSourceCode=std::string(), const std::string &postfixSourceCode=std::string())
static Pointer GetInstance()
#define ITK_OPENCL_DECLARE_PRIVATE(Class)
OpenCLCommandQueue GetCommandQueue()
OpenCLProgram BuildProgramFromSourceCode(const std::list< OpenCLDevice > &devices, const std::string &sourceCode, const std::string &prefixSourceCode=std::string(), const std::string &postfixSourceCode=std::string(), const std::string &extraBuildOptions=std::string())
The OpenCLImage class represents an image object is used to store a one, two or three dimensional tex...
SmartPointer< const Self > ConstPointer
OpenCLBuffer CreateBufferCopy(const void *data, const OpenCLMemoryObject::Access access, const std::vcl_size_t size)
void SetContextId(cl_context id)
OpenCLBuffer CreateBufferDevice(const OpenCLMemoryObject::Access access, const std::vcl_size_t size)
The OpenCLContext class represents an OpenCL context.
The OpenCLVector class represents a templated OpenCL buffer object.
void SetLastError(const cl_int error)
OpenCLSampler CreateSampler(const bool normalizedCoordinates, const OpenCLSampler::AddressingMode addressingMode, const OpenCLSampler::FilterMode filterMode)
OpenCLCommandQueue CreateCommandQueue(const cl_command_queue_properties properties, const OpenCLDevice &device=OpenCLDevice())
bool Create(const OpenCLPlatform &platfrom, const OpenCLDevice::DeviceType type=OpenCLDevice::Default)
SmartPointer< Self > Pointer
static std::string GetErrorName(const cl_int code)
OpenCLCommandQueue GetDefaultCommandQueue()
The OpenCLBuffer class represents an OpenCL buffer object.
Generated on OURCE_DATE_EPOCH for elastix by 1.8.18 |
|