Loading...
Searching...
No Matches
itkOpenCLBuffer.h
Go to the documentation of this file.
/*=========================================================================
*
* Copyright UMC Utrecht and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
/*=========================================================================
*
* Copyright UMC Utrecht and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0.txt
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*=========================================================================*/
#ifndef itkOpenCLBuffer_h
#define itkOpenCLBuffer_h
#include "itkOpenCLMemoryObject.h"
#include "itkOpenCLEvent.h"
namespace itk
{
// Forward declaration
class OpenCLImage;
class ITKOpenCL_EXPORT OpenCLBuffer : public OpenCLMemoryObject
{
public:
using Self = OpenCLBuffer;
OpenCLBuffer() = default;
OpenCLBuffer(OpenCLContext * context, const cl_mem id);
OpenCLBuffer(const OpenCLBuffer & other);
OpenCLBuffer &
operator=(const OpenCLBuffer & other);
bool
Read(void * data, const std::size_t size, const std::size_t offset = 0);
OpenCLEvent
ReadAsync(void * data,
const std::size_t size,
const OpenCLEventList & event_list = OpenCLEventList(),
const std::size_t offset = 0);
bool
Write(const void * data, const std::size_t size, const std::size_t offset = 0);
OpenCLEvent
WriteAsync(const void * data,
const std::size_t size,
const OpenCLEventList & event_list = OpenCLEventList(),
const std::size_t offset = 0);
bool
ReadRect(void * data,
const RectangleType & rect,
const std::size_t bufferBytesPerLine,
const std::size_t hostBytesPerLine);
OpenCLEvent
ReadRectAsync(void * data,
const RectangleType & rect,
const std::size_t bufferBytesPerLine,
const std::size_t hostBytesPerLine,
const OpenCLEventList & event_list = OpenCLEventList());
bool
ReadRect(void * data,
const std::size_t origin[3],
const std::size_t size[3],
const std::size_t bufferBytesPerLine,
const std::size_t bufferBytesPerSlice,
const std::size_t hostBytesPerLine,
const std::size_t hostBytesPerSlice);
OpenCLEvent
ReadRectAsync(void * data,
const std::size_t origin[3],
const std::size_t size[3],
const std::size_t bufferBytesPerLine,
const std::size_t bufferBytesPerSlice,
const std::size_t hostBytesPerLine,
const std::size_t hostBytesPerSlice,
const OpenCLEventList & event_list = OpenCLEventList());
bool
WriteRect(const void * data,
const RectangleType & rect,
const std::size_t bufferBytesPerLine,
const std::size_t hostBytesPerLine);
OpenCLEvent
WriteRectAsync(const void * data,
const RectangleType & rect,
const std::size_t bufferBytesPerLine,
const std::size_t hostBytesPerLine,
const OpenCLEventList & event_list = OpenCLEventList());
bool
WriteRect(const void * data,
const std::size_t origin[3],
const std::size_t size[3],
const std::size_t bufferBytesPerLine,
const std::size_t bufferBytesPerSlice,
const std::size_t hostBytesPerLine,
const std::size_t hostBytesPerSlice);
OpenCLEvent
WriteRectAsync(const void * data,
const std::size_t origin[3],
const std::size_t size[3],
const std::size_t bufferBytesPerLine,
const std::size_t bufferBytesPerSlice,
const std::size_t hostBytesPerLine,
const std::size_t hostBytesPerSlice,
const OpenCLEventList & event_list = OpenCLEventList());
bool
CopyToBuffer(const OpenCLBuffer & dest,
const std::size_t size,
const std::size_t dst_offset = 0,
const std::size_t offset = 0);
OpenCLEvent
CopyToBufferAsync(const OpenCLBuffer & dest,
const std::size_t size,
const OpenCLEventList & event_list = OpenCLEventList(),
const std::size_t dst_offset = 0,
const std::size_t offset = 0);
bool
CopyToImage(const OpenCLImage & dest,
const OpenCLSize & origin,
const OpenCLSize & region,
const std::size_t src_offset = 0);
OpenCLEvent
CopyToImageAsync(const OpenCLImage & dest,
const OpenCLSize & origin,
const OpenCLSize & region,
const OpenCLEventList & event_list = OpenCLEventList(),
const std::size_t src_offset = 0);
bool
CopyToRect(const OpenCLBuffer & dest,
const RectangleType & rect,
const PointType & destPoint,
const std::size_t bufferBytesPerLine,
std::size_t destBytesPerLine);
OpenCLEvent
CopyToRectAsync(const OpenCLBuffer & dest,
const RectangleType & rect,
const PointType & destPoint,
const std::size_t bufferBytesPerLine,
const std::size_t destBytesPerLine,
const OpenCLEventList & event_list = OpenCLEventList());
bool
CopyToRect(const OpenCLBuffer & dest,
const std::size_t origin[3],
const std::size_t size[3],
const std::size_t destOrigin[3],
const std::size_t bufferBytesPerLine,
const std::size_t bufferBytesPerSlice,
const std::size_t destBytesPerLine,
const std::size_t destBytesPerSlice);
OpenCLEvent
CopyToRectAsync(const OpenCLBuffer & dest,
const std::size_t origin[3],
const std::size_t size[3],
const std::size_t destOrigin[3],
const std::size_t bufferBytesPerLine,
const std::size_t bufferBytesPerSlice,
const std::size_t destBytesPerLine,
const std::size_t destBytesPerSlice,
const OpenCLEventList & event_list = OpenCLEventList());
void *
Map(const OpenCLMemoryObject::Access access, const std::size_t size, const std::size_t offset = 0);
OpenCLEvent
MapAsync(void ** ptr,
const OpenCLMemoryObject::Access access,
const std::size_t size,
const OpenCLEventList & event_list = OpenCLEventList(),
const std::size_t offset = 0);
void *
Map(const OpenCLMemoryObject::Access access);
OpenCLBuffer
CreateSubBuffer(const OpenCLMemoryObject::Access access, const std::size_t size, const std::size_t offset = 0);
OpenCLBuffer
GetParentBuffer() const;
std::size_t
GetOffset() const;
};
} // end namespace itk
#endif /* itkOpenCLBuffer_h */
itk::OpenCLBuffer::CopyToImage
bool CopyToImage(const OpenCLImage &dest, const OpenCLSize &origin, const OpenCLSize &region, const std::vcl_size_t src_offset=0)
itk::OpenCLBuffer::CreateSubBuffer
OpenCLBuffer CreateSubBuffer(const OpenCLMemoryObject::Access access, const std::vcl_size_t size, const std::vcl_size_t offset=0)
itk::OpenCLBuffer::CopyToBuffer
bool CopyToBuffer(const OpenCLBuffer &dest, const std::vcl_size_t size, const std::vcl_size_t dst_offset=0, const std::vcl_size_t offset=0)
itk::OpenCLBuffer::MapAsync
OpenCLEvent MapAsync(void **ptr, const OpenCLMemoryObject::Access access, const std::vcl_size_t size, const OpenCLEventList &event_list=OpenCLEventList(), const std::vcl_size_t offset=0)
itk::OpenCLBuffer::CopyToRect
bool CopyToRect(const OpenCLBuffer &dest, const std::vcl_size_t origin[3], const std::vcl_size_t size[3], const std::vcl_size_t destOrigin[3], const std::vcl_size_t bufferBytesPerLine, const std::vcl_size_t bufferBytesPerSlice, const std::vcl_size_t destBytesPerLine, const std::vcl_size_t destBytesPerSlice)
itk::OpenCLBuffer::WriteAsync
OpenCLEvent WriteAsync(const void *data, const std::vcl_size_t size, const OpenCLEventList &event_list=OpenCLEventList(), const std::vcl_size_t offset=0)
itk::OpenCLBuffer::Map
void * Map(const OpenCLMemoryObject::Access access, const std::vcl_size_t size, const std::vcl_size_t offset=0)
itk::OpenCLBuffer::CopyToImageAsync
OpenCLEvent CopyToImageAsync(const OpenCLImage &dest, const OpenCLSize &origin, const OpenCLSize &region, const OpenCLEventList &event_list=OpenCLEventList(), const std::vcl_size_t src_offset=0)
itk::OpenCLBuffer::WriteRectAsync
OpenCLEvent WriteRectAsync(const void *data, const RectangleType &rect, const std::vcl_size_t bufferBytesPerLine, const std::vcl_size_t hostBytesPerLine, const OpenCLEventList &event_list=OpenCLEventList())
itk::OpenCLBuffer::Read
bool Read(void *data, const std::vcl_size_t size, const std::vcl_size_t offset=0)
itk::OpenCLBuffer::ReadRect
bool ReadRect(void *data, const std::vcl_size_t origin[3], const std::vcl_size_t size[3], const std::vcl_size_t bufferBytesPerLine, const std::vcl_size_t bufferBytesPerSlice, const std::vcl_size_t hostBytesPerLine, const std::vcl_size_t hostBytesPerSlice)
itk::OpenCLBuffer::Map
void * Map(const OpenCLMemoryObject::Access access)
itk::OpenCLBuffer::ReadAsync
OpenCLEvent ReadAsync(void *data, const std::vcl_size_t size, const OpenCLEventList &event_list=OpenCLEventList(), const std::vcl_size_t offset=0)
itk::OpenCLBuffer::GetOffset
std::vcl_size_t GetOffset() const
itk::OpenCLBuffer::WriteRectAsync
OpenCLEvent WriteRectAsync(const void *data, const std::vcl_size_t origin[3], const std::vcl_size_t size[3], const std::vcl_size_t bufferBytesPerLine, const std::vcl_size_t bufferBytesPerSlice, const std::vcl_size_t hostBytesPerLine, const std::vcl_size_t hostBytesPerSlice, const OpenCLEventList &event_list=OpenCLEventList())
itk::OpenCLBuffer::ReadRect
bool ReadRect(void *data, const RectangleType &rect, const std::vcl_size_t bufferBytesPerLine, const std::vcl_size_t hostBytesPerLine)
itk::OpenCLBuffer::OpenCLBuffer
OpenCLBuffer()=default
itk::OpenCLBuffer::CopyToRectAsync
OpenCLEvent CopyToRectAsync(const OpenCLBuffer &dest, const std::vcl_size_t origin[3], const std::vcl_size_t size[3], const std::vcl_size_t destOrigin[3], const std::vcl_size_t bufferBytesPerLine, const std::vcl_size_t bufferBytesPerSlice, const std::vcl_size_t destBytesPerLine, const std::vcl_size_t destBytesPerSlice, const OpenCLEventList &event_list=OpenCLEventList())
itk::OpenCLBuffer::CopyToRectAsync
OpenCLEvent CopyToRectAsync(const OpenCLBuffer &dest, const RectangleType &rect, const PointType &destPoint, const std::vcl_size_t bufferBytesPerLine, const std::vcl_size_t destBytesPerLine, const OpenCLEventList &event_list=OpenCLEventList())
itk::OpenCLBuffer::ReadRectAsync
OpenCLEvent ReadRectAsync(void *data, const RectangleType &rect, const std::vcl_size_t bufferBytesPerLine, const std::vcl_size_t hostBytesPerLine, const OpenCLEventList &event_list=OpenCLEventList())
itk::OpenCLBuffer::Write
bool Write(const void *data, const std::vcl_size_t size, const std::vcl_size_t offset=0)
itk::OpenCLBuffer::operator=
OpenCLBuffer & operator=(const OpenCLBuffer &other)
itk::OpenCLBuffer::OpenCLBuffer
OpenCLBuffer(const OpenCLBuffer &other)
itk::OpenCLBuffer::ReadRectAsync
OpenCLEvent ReadRectAsync(void *data, const std::vcl_size_t origin[3], const std::vcl_size_t size[3], const std::vcl_size_t bufferBytesPerLine, const std::vcl_size_t bufferBytesPerSlice, const std::vcl_size_t hostBytesPerLine, const std::vcl_size_t hostBytesPerSlice, const OpenCLEventList &event_list=OpenCLEventList())
itk::OpenCLBuffer::WriteRect
bool WriteRect(const void *data, const std::vcl_size_t origin[3], const std::vcl_size_t size[3], const std::vcl_size_t bufferBytesPerLine, const std::vcl_size_t bufferBytesPerSlice, const std::vcl_size_t hostBytesPerLine, const std::vcl_size_t hostBytesPerSlice)
itk::OpenCLBuffer::CopyToBufferAsync
OpenCLEvent CopyToBufferAsync(const OpenCLBuffer &dest, const std::vcl_size_t size, const OpenCLEventList &event_list=OpenCLEventList(), const std::vcl_size_t dst_offset=0, const std::vcl_size_t offset=0)
itk::OpenCLBuffer::OpenCLBuffer
OpenCLBuffer(OpenCLContext *context, const cl_mem id)
itk::OpenCLBuffer::WriteRect
bool WriteRect(const void *data, const RectangleType &rect, const std::vcl_size_t bufferBytesPerLine, const std::vcl_size_t hostBytesPerLine)
itk::OpenCLBuffer::Self
OpenCLBuffer Self
Definition itkOpenCLBuffer.h:57
itk::OpenCLBuffer::CopyToRect
bool CopyToRect(const OpenCLBuffer &dest, const RectangleType &rect, const PointType &destPoint, const std::vcl_size_t bufferBytesPerLine, std::vcl_size_t destBytesPerLine)
itk::OpenCLBuffer::GetParentBuffer
OpenCLBuffer GetParentBuffer() const
itk::OpenCLContext
The OpenCLContext class represents an OpenCL context.
Definition itkOpenCLContext.h:77
itk::OpenCLEventList
OpenCLEventList class represents a list of OpenCLEvent objects.
Definition itkOpenCLEventList.h:33
itk::OpenCLEvent
OpenCLEvent class represents an OpenCL event object.
Definition itkOpenCLEvent.h:93
itk::OpenCLImage
The OpenCLImage class represents an image object is used to store a one, two or three dimensional tex...
Definition itkOpenCLImage.h:39
itk::OpenCLMemoryObject::OpenCLMemoryObject
OpenCLMemoryObject(OpenCLContext *context=0)
Definition itkOpenCLMemoryObject.h:42
itk::OpenCLMemoryObject::Access
Access
Definition itkOpenCLMemoryObject.h:87
itk::OpenCLMemoryObject::PointType
Point< std::vcl_size_t, 2 > PointType
Definition itkOpenCLMemoryObject.h:66
itk::OpenCLMemoryObject::RectangleType
Size< 4 > RectangleType
Definition itkOpenCLMemoryObject.h:65
itk::OpenCLSize
The OpenCLSize class defines the size of an item of work for an OpenCL kernel.
Definition itkOpenCLSize.h:50
itkOpenCLEvent.h
ITKOpenCL_EXPORT
#define ITKOpenCL_EXPORT
Definition itkOpenCLExport.h:33
itkOpenCLMemoryObject.h
itk
Definition itkAdvancedImageToImageMetric.h:43

Generated on 1768596610 for elastix by 1.15.0 |