Loading...
Searching...
No Matches
itkOpenCLVector.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.
*
*=========================================================================*/
#ifndef itkOpenCLVector_h
#define itkOpenCLVector_h
#include "itkOpenCLVectorBase.h"
#include "itkOpenCLBuffer.h"
#include "itkMacro.h"
namespace itk
{
template <typename T>
class ITK_TEMPLATE_EXPORT OpenCLVector : public OpenCLVectorBase
{
public:
using Self = OpenCLVector;
OpenCLVector();
OpenCLVector(const OpenCLVector<T> & other);
~OpenCLVector();
OpenCLVector<T> &
operator=(const OpenCLVector<T> & other);
bool
IsNull() const;
void
Release();
bool
IsEmpty() const
{
return this->m_Size == 0;
}
std::size_t
GetSize() const
{
return this->m_Size;
}
T & operator[](const std::size_t index);
const T & operator[](const std::size_t index) const;
void
Read(T * data, const std::size_t count, const std::size_t offset = 0);
void
Write(const T * data, const std::size_t count, const std::size_t offset = 0);
void
Write(const Vector<T> & data, const std::size_t offset = 0);
OpenCLContext *
GetContext() const;
OpenCLBuffer
GetBuffer() const;
private:
OpenCLVector(OpenCLContext * context, const OpenCLMemoryObject::Access access, const std::size_t size);
friend class OpenCLContext;
};
//------------------------------------------------------------------------------
template <typename charT, typename traits, typename dataType>
inline std::basic_ostream<charT, traits> &
operator<<(std::basic_ostream<charT, traits> & strm, const OpenCLVector<dataType> & vector)
{
if (vector.IsNull())
{
strm << "OpenCLVector(null)";
return strm;
}
const char indent = ' ';
strm << "OpenCLVector\n" << indent << "Size: " << vector.GetSize() << std::endl;
strm << std::endl;
return strm;
}
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
# include "itkOpenCLVector.hxx"
#endif
#endif /* itkOpenCLVector_h */
itk::OpenCLBuffer
The OpenCLBuffer class represents an OpenCL buffer object.
Definition itkOpenCLBuffer.h:54
itk::OpenCLMemoryObject::Access
Access
Definition itkOpenCLMemoryObject.h:87
itk::OpenCLVectorBase::OpenCLVectorBase
OpenCLVectorBase(const std::vcl_size_t elemSize)
itk::OpenCLVectorBase::m_Size
std::vcl_size_t m_Size
Definition itkOpenCLVectorBase.h:100
itk::OpenCLVector
The OpenCLVector class represents a templated OpenCL buffer object.
Definition itkOpenCLVector.h:53
itk::OpenCLVector::GetContext
OpenCLContext * GetContext() const
itk::OpenCLVector::OpenCLVector
OpenCLVector(const OpenCLVector< T > &other)
itk::OpenCLVector::operator[]
T & operator[](const std::vcl_size_t index)
itk::OpenCLVector::operator[]
const T & operator[](const std::vcl_size_t index) const
itk::OpenCLVector::OpenCLVector
OpenCLVector()
itk::OpenCLVector::~OpenCLVector
~OpenCLVector()
itk::OpenCLVector::OpenCLContext
friend class OpenCLContext
Definition itkOpenCLVector.h:140
itk::OpenCLVector::GetSize
std::vcl_size_t GetSize() const
Definition itkOpenCLVector.h:97
itk::OpenCLVector::operator=
OpenCLVector< T > & operator=(const OpenCLVector< T > &other)
itk::OpenCLVector::Self
OpenCLVector Self
Definition itkOpenCLVector.h:56
itk::OpenCLVector::Write
void Write(const T *data, const std::vcl_size_t count, const std::vcl_size_t offset=0)
itk::OpenCLVector::Write
void Write(const Vector< T > &data, const std::vcl_size_t offset=0)
itk::OpenCLVector::Release
void Release()
itk::OpenCLVector::IsEmpty
bool IsEmpty() const
Definition itkOpenCLVector.h:90
itk::OpenCLVector::IsNull
bool IsNull() const
itk::OpenCLVector::OpenCLVector
OpenCLVector(OpenCLContext *context, const OpenCLMemoryObject::Access access, const std::vcl_size_t size)
itk::OpenCLVector::Read
void Read(T *data, const std::vcl_size_t count, const std::vcl_size_t offset=0)
itk::OpenCLVector::GetBuffer
OpenCLBuffer GetBuffer() const
itkOpenCLBuffer.h
itkOpenCLVectorBase.h
itk
Definition itkAdvancedImageToImageMetric.h:43
itk::operator<<
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &strm, const OpenCLCommandQueue &queue)
Definition itkOpenCLCommandQueue.h:135

Generated on 1768596610 for elastix by 1.15.0 |