Loading...
Searching...
No Matches
itkOpenCLEventList.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 itkOpenCLEventList_h
#define itkOpenCLEventList_h
#include "itkOpenCLEvent.h"
#include <vector>
namespace itk
{
class ITKOpenCL_EXPORT OpenCLEventList
{
public:
using Self = OpenCLEventList;
using OpenCLEventListArrayType = std::vector<cl_event>;
OpenCLEventList() = default;
OpenCLEventList(const OpenCLEvent & event);
OpenCLEventList(const OpenCLEventList & other);
~OpenCLEventList();
OpenCLEventList &
operator=(const OpenCLEventList & other);
bool
IsEmpty() const
{
return this->m_Events.empty();
}
std::size_t
GetSize() const
{
return this->m_Events.size();
}
void
Append(const OpenCLEvent & event);
void
Append(const OpenCLEventList & other);
void
Remove(const OpenCLEvent & event);
OpenCLEvent
Get(const std::size_t index) const;
bool
Contains(const OpenCLEvent & event) const;
const cl_event *
GetEventData() const;
const OpenCLEventListArrayType &
GetEventArray() const;
OpenCLEventList &
operator+=(const OpenCLEvent & event);
OpenCLEventList &
operator+=(const OpenCLEventList & other);
OpenCLEventList &
operator<<(const OpenCLEvent & event);
OpenCLEventList &
operator<<(const OpenCLEventList & other);
cl_int
WaitForFinished();
private:
OpenCLEventListArrayType m_Events;
};
bool ITKOpenCL_EXPORT
operator==(const OpenCLEventList & lhs, const OpenCLEventList & rhs);
bool ITKOpenCL_EXPORT
operator!=(const OpenCLEventList & lhs, const OpenCLEventList & rhs);
template <typename charT, typename traits>
inline std::basic_ostream<charT, traits> &
operator<<(std::basic_ostream<charT, traits> & strm, const OpenCLEventList & eventlist)
{
if (!eventlist.GetSize())
{
strm << "OpenCLEventList()";
return strm;
}
OpenCLEventList::OpenCLEventListArrayType::const_iterator it;
const OpenCLEventList::OpenCLEventListArrayType & eventsArray = eventlist.GetEventArray();
std::size_t id = 0;
strm << "OpenCLEventList contains:" << std::endl;
for (it = eventsArray.begin(); it < eventsArray.end(); ++it)
{
// const OpenCLEvent &event = *it;
// strm << "array id: " << id << " " << event << std::endl;
// Let's print only address, printing the OpenCLEvent
// could halt execution of the program
strm << "array id: " << id << " " << *it << std::endl;
++id;
}
return strm;
}
} // end namespace itk
#endif /* itkOpenCLEventList_h */
itk::OpenCLEventList
OpenCLEventList class represents a list of OpenCLEvent objects.
Definition itkOpenCLEventList.h:33
itk::OpenCLEventList::m_Events
OpenCLEventListArrayType m_Events
Definition itkOpenCLEventList.h:142
itk::OpenCLEventList::operator<<
OpenCLEventList & operator<<(const OpenCLEvent &event)
itk::OpenCLEventList::OpenCLEventList
OpenCLEventList(const OpenCLEventList &other)
itk::OpenCLEventList::Get
OpenCLEvent Get(const std::vcl_size_t index) const
itk::OpenCLEventList::operator+=
OpenCLEventList & operator+=(const OpenCLEventList &other)
itk::OpenCLEventList::OpenCLEventListArrayType
std::vector< cl_event > OpenCLEventListArrayType
Definition itkOpenCLEventList.h:38
itk::OpenCLEventList::OpenCLEventList
OpenCLEventList(const OpenCLEvent &event)
itk::OpenCLEventList::GetSize
std::vcl_size_t GetSize() const
Definition itkOpenCLEventList.h:70
itk::OpenCLEventList::OpenCLEventList
OpenCLEventList()=default
itk::OpenCLEventList::WaitForFinished
cl_int WaitForFinished()
itk::OpenCLEventList::IsEmpty
bool IsEmpty() const
Definition itkOpenCLEventList.h:62
itk::OpenCLEventList::operator=
OpenCLEventList & operator=(const OpenCLEventList &other)
itk::OpenCLEventList::GetEventArray
const OpenCLEventListArrayType & GetEventArray() const
itk::OpenCLEventList::operator+=
OpenCLEventList & operator+=(const OpenCLEvent &event)
itk::OpenCLEventList::Self
OpenCLEventList Self
Definition itkOpenCLEventList.h:36
itk::OpenCLEventList::Remove
void Remove(const OpenCLEvent &event)
itk::OpenCLEventList::Contains
bool Contains(const OpenCLEvent &event) const
itk::OpenCLEventList::GetEventData
const cl_event * GetEventData() const
itk::OpenCLEventList::~OpenCLEventList
~OpenCLEventList()
itk::OpenCLEvent
OpenCLEvent class represents an OpenCL event object.
Definition itkOpenCLEvent.h:93
itkOpenCLEvent.h
ITKOpenCL_EXPORT
#define ITKOpenCL_EXPORT
Definition itkOpenCLExport.h:33
itk
Definition itkAdvancedImageToImageMetric.h:43
itk::operator==
bool ITKOpenCL_EXPORT operator==(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
itk::operator!=
bool ITKOpenCL_EXPORT operator!=(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
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 |