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:
35
38
39 typedef std::vector< cl_event > OpenCLEventListArrayType;
40
43
47 OpenCLEventList( const OpenCLEvent & event );
48
52
55
58
61 bool IsEmpty() const { return this->m_Events.empty(); }
62
65 std::size_t GetSize() const { return this->m_Events.size(); }
66
70 void Append( const OpenCLEvent & event );
71
73 void Append( const OpenCLEventList & other );
74
77 void Remove( const OpenCLEvent & event );
78
82 OpenCLEvent Get( const std::size_t index ) const;
83
86 bool Contains( const OpenCLEvent & event ) const;
87
93 const cl_event * GetEventData() const;
94
98
102
106
110
114
120
121private:
122
124};
125
130
135
137template< typename charT, typename traits >
138inline
139std::basic_ostream< charT, traits > &
140operator<<( std::basic_ostream< charT, traits > & strm,
141 const OpenCLEventList & eventlist )
142{
143 if( !eventlist.GetSize() )
144 {
145 strm << "OpenCLEventList()";
146 return strm;
147 }
148
149 OpenCLEventList::OpenCLEventListArrayType::const_iterator it;
150 const OpenCLEventList::OpenCLEventListArrayType & eventsArray = eventlist.GetEventArray();
151
152 std::size_t id = 0;
153 strm << "OpenCLEventList contains:" << std::endl;
154 for( it = eventsArray.begin(); it < eventsArray.end(); ++it )
155 {
156 // const OpenCLEvent &event = *it;
157 // strm << "array id: " << id << " " << event << std::endl;
158
159 // Let's print only address, printing the OpenCLEvent
160 // could halt execution of the program
161 strm << "array id: " << id << " " << *it << std::endl;
162 ++id;
163 }
164
165 return strm;
166}
167
168
169} // end namespace itk
170
171#endif /* __itkOpenCLEventList_h */
OpenCLEventList class represents a list of OpenCLEvent objects.
OpenCLEventListArrayType m_Events
OpenCLEventList & operator<<(const OpenCLEvent &event)
OpenCLEventList(const OpenCLEventList &other)
std::vector< cl_event > OpenCLEventListArrayType
OpenCLEvent Get(const std::vcl_size_t index) const
OpenCLEventList & operator+=(const OpenCLEventList &other)
OpenCLEventList(const OpenCLEvent &event)
std::vcl_size_t GetSize() const
OpenCLEventList & operator<<(const OpenCLEventList &other)
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 1667476801 for elastix by doxygen 1.9.4 elastix logo