Loading...
Searching...
No Matches
itkOpenCLCommandQueue.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 itkOpenCLCommandQueue_h
#define itkOpenCLCommandQueue_h
#include "itkOpenCL.h"
#include <ostream>
namespace itk
{
// Forward declaration
class OpenCLContext;
class ITKOpenCL_EXPORT OpenCLCommandQueue
{
public:
using Self = OpenCLCommandQueue;
OpenCLCommandQueue()
: m_Context(0)
, m_Id(0)
{}
OpenCLCommandQueue(OpenCLContext * context, cl_command_queue id)
: m_Context(context)
, m_Id(id)
{}
OpenCLCommandQueue(const OpenCLCommandQueue & other);
~OpenCLCommandQueue();
OpenCLCommandQueue &
operator=(const OpenCLCommandQueue & other);
bool
IsNull() const
{
return this->m_Id == 0;
}
bool
IsOutOfOrder() const;
bool
IsProfilingEnabled() const;
cl_command_queue
GetQueueId() const
{
return this->m_Id;
}
OpenCLContext *
GetContext() const
{
return this->m_Context;
}
private:
OpenCLContext * m_Context;
cl_command_queue m_Id;
};
bool ITKOpenCL_EXPORT
operator==(const OpenCLCommandQueue & lhs, const OpenCLCommandQueue & rhs);
bool ITKOpenCL_EXPORT
operator!=(const OpenCLCommandQueue & lhs, const OpenCLCommandQueue & rhs);
template <typename charT, typename traits>
inline std::basic_ostream<charT, traits> &
operator<<(std::basic_ostream<charT, traits> & strm, const OpenCLCommandQueue & queue)
{
if (queue.IsNull())
{
strm << "OpenCLCommandQueue(null)";
return strm;
}
const char indent = ' ';
strm << "OpenCLCommandQueue\n"
<< indent << "Id: " << queue.GetQueueId() << '\n'
<< indent << "Out of order: " << (queue.IsOutOfOrder() ? "Yes" : "No") << '\n'
<< indent << "Profiling enabled: " << (queue.IsProfilingEnabled() ? "Yes" : "No") << std::endl;
return strm;
}
} // end namespace itk
#endif /* itkOpenCLCommandQueue_h */
itk::OpenCLCommandQueue
The OpenCLCommandQueue class represents an OpenCL a command-queue on a specific device and valid Open...
Definition itkOpenCLCommandQueue.h:52
itk::OpenCLCommandQueue::GetContext
OpenCLContext * GetContext() const
Definition itkOpenCLCommandQueue.h:110
itk::OpenCLCommandQueue::m_Id
cl_command_queue m_Id
Definition itkOpenCLCommandQueue.h:117
itk::OpenCLCommandQueue::GetQueueId
cl_command_queue GetQueueId() const
Definition itkOpenCLCommandQueue.h:103
itk::OpenCLCommandQueue::operator=
OpenCLCommandQueue & operator=(const OpenCLCommandQueue &other)
itk::OpenCLCommandQueue::m_Context
OpenCLContext * m_Context
Definition itkOpenCLCommandQueue.h:116
itk::OpenCLCommandQueue::IsNull
bool IsNull() const
Definition itkOpenCLCommandQueue.h:84
itk::OpenCLCommandQueue::OpenCLCommandQueue
OpenCLCommandQueue()
Definition itkOpenCLCommandQueue.h:58
itk::OpenCLCommandQueue::OpenCLCommandQueue
OpenCLCommandQueue(OpenCLContext *context, cl_command_queue id)
Definition itkOpenCLCommandQueue.h:66
itk::OpenCLCommandQueue::~OpenCLCommandQueue
~OpenCLCommandQueue()
itk::OpenCLCommandQueue::Self
OpenCLCommandQueue Self
Definition itkOpenCLCommandQueue.h:55
itk::OpenCLCommandQueue::IsProfilingEnabled
bool IsProfilingEnabled() const
itk::OpenCLCommandQueue::IsOutOfOrder
bool IsOutOfOrder() const
itk::OpenCLCommandQueue::OpenCLCommandQueue
OpenCLCommandQueue(const OpenCLCommandQueue &other)
itk::OpenCLContext
The OpenCLContext class represents an OpenCL context.
Definition itkOpenCLContext.h:77
ITKOpenCL_EXPORT
#define ITKOpenCL_EXPORT
Definition itkOpenCLExport.h:33
itkOpenCL.h
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 |