go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkOpenCLEventList.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright UMC Utrecht and contributors
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkOpenCLEventList_h
19#define itkOpenCLEventList_h
20
21#include "itkOpenCLEvent.h"
22#include <vector>
23
24namespace itk
25{
33{
34public:
37
38 using OpenCLEventListArrayType = std::vector<cl_event>;
39
41 OpenCLEventList() = default;
42
47
51
54
57 operator=(const OpenCLEventList & other);
58
61 bool
62 IsEmpty() const
63 {
64 return this->m_Events.empty();
65 }
66
69 std::size_t
70 GetSize() const
71 {
72 return this->m_Events.size();
73 }
74
78 void
79 Append(const OpenCLEvent & event);
80
82 void
83 Append(const OpenCLEventList & other);
84
87 void
88 Remove(const OpenCLEvent & event);
89
94 Get(const std::size_t index) const;
95
98 bool
99 Contains(const OpenCLEvent & event) const;
100
106 const cl_event *
108
113
117 operator+=(const OpenCLEvent & event);
118
123
127 operator<<(const OpenCLEvent & event);
128
132 operator<<(const OpenCLEventList & other);
133
138 cl_int
140
141private:
143};
144
149 operator==(const OpenCLEventList & lhs, const OpenCLEventList & rhs);
150
155 operator!=(const OpenCLEventList & lhs, const OpenCLEventList & rhs);
156
158template <typename charT, typename traits>
159inline std::basic_ostream<charT, traits> &
160operator<<(std::basic_ostream<charT, traits> & strm, const OpenCLEventList & eventlist)
161{
162 if (!eventlist.GetSize())
163 {
164 strm << "OpenCLEventList()";
165 return strm;
166 }
167
168 OpenCLEventList::OpenCLEventListArrayType::const_iterator it;
169 const OpenCLEventList::OpenCLEventListArrayType & eventsArray = eventlist.GetEventArray();
170
171 std::size_t id = 0;
172 strm << "OpenCLEventList contains:" << std::endl;
173 for (it = eventsArray.begin(); it < eventsArray.end(); ++it)
174 {
175 // const OpenCLEvent &event = *it;
176 // strm << "array id: " << id << " " << event << std::endl;
177
178 // Let's print only address, printing the OpenCLEvent
179 // could halt execution of the program
180 strm << "array id: " << id << " " << *it << std::endl;
181 ++id;
182 }
183
184 return strm;
185}
186
187
188} // end namespace itk
189
190#endif /* itkOpenCLEventList_h */
OpenCLEventList class represents a list of OpenCLEvent objects.
OpenCLEventListArrayType m_Events
OpenCLEventList(const OpenCLEventList &other)
OpenCLEvent Get(const std::vcl_size_t index) const
OpenCLEventList & operator+=(const OpenCLEventList &other)
std::vector< cl_event > OpenCLEventListArrayType
OpenCLEventList(const OpenCLEvent &event)
std::vcl_size_t GetSize() const
OpenCLEventList()=default
OpenCLEventList & operator=(const OpenCLEventList &other)
const OpenCLEventListArrayType & GetEventArray() const
OpenCLEventList & operator+=(const OpenCLEvent &event)
void Remove(const OpenCLEvent &event)
bool Contains(const OpenCLEvent &event) const
const cl_event * GetEventData() const
OpenCLEvent class represents an OpenCL event object.
#define ITKOpenCL_EXPORT
bool ITKOpenCL_EXPORT operator==(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
bool ITKOpenCL_EXPORT operator!=(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &strm, const OpenCLCommandQueue &queue)


Generated on 2023-01-13 for elastix by doxygen 1.9.6 elastix logo