Loading...
Searching...
No Matches
itkOpenCLProgram.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 itkOpenCLProgram_h
#define itkOpenCLProgram_h
#include "itkOpenCLDevice.h"
#include "itkOpenCLKernel.h"
#include <string>
namespace itk
{
// Forward declaration
class OpenCLContext;
class ITKOpenCL_EXPORT OpenCLProgram
{
public:
using Self = OpenCLProgram;
OpenCLProgram();
OpenCLProgram(OpenCLContext * context, cl_program id, const std::string & fileName = std::string());
OpenCLProgram(const OpenCLProgram & other);
~OpenCLProgram();
OpenCLProgram &
operator=(const OpenCLProgram & other);
bool
IsNull() const
{
return this->m_Id == 0;
}
OpenCLContext *
GetContext() const
{
return this->m_Context;
}
cl_program
GetProgramId() const
{
return this->m_Id;
}
std::string
GetFileName() const
{
return this->m_FileName;
}
bool
Build(const std::string & extraBuildOptions = std::string());
bool
Build(const std::list<OpenCLDevice> & devices, const std::string & extraBuildOptions = std::string());
std::string
GetLog() const;
std::list<OpenCLDevice>
GetDevices() const;
OpenCLKernel
CreateKernel(const std::string & name) const;
std::list<OpenCLKernel>
CreateKernels() const;
private:
OpenCLContext * m_Context;
cl_program m_Id;
std::string m_FileName;
};
bool ITKOpenCL_EXPORT
operator==(const OpenCLProgram & lhs, const OpenCLProgram & rhs);
bool ITKOpenCL_EXPORT
operator!=(const OpenCLProgram & lhs, const OpenCLProgram & rhs);
template <typename charT, typename traits>
inline std::basic_ostream<charT, traits> &
operator<<(std::basic_ostream<charT, traits> & strm, const OpenCLProgram & program)
{
if (program.IsNull())
{
strm << "OpenCLProgram(null)";
return strm;
}
const char indent = ' ';
strm << "OpenCLProgram\n" << indent << "Id: " << program.GetProgramId() << std::endl;
return strm;
}
} // end namespace itk
#endif /* itkOpenCLProgram_h */
itk::OpenCLContext
The OpenCLContext class represents an OpenCL context.
Definition itkOpenCLContext.h:77
itk::OpenCLKernel
The OpenCLKernel class represents an executable entry point function in an OpenCL program.
Definition itkOpenCLKernel.h:136
itk::OpenCLProgram
The OpenCLProgram class represents an OpenCL program object.
Definition itkOpenCLProgram.h:38
itk::OpenCLProgram::CreateKernel
OpenCLKernel CreateKernel(const std::string &name) const
itk::OpenCLProgram::m_Context
OpenCLContext * m_Context
Definition itkOpenCLProgram.h:133
itk::OpenCLProgram::m_Id
cl_program m_Id
Definition itkOpenCLProgram.h:134
itk::OpenCLProgram::GetLog
std::string GetLog() const
itk::OpenCLProgram::GetFileName
std::string GetFileName() const
Definition itkOpenCLProgram.h:85
itk::OpenCLProgram::OpenCLProgram
OpenCLProgram(const OpenCLProgram &other)
itk::OpenCLProgram::GetContext
OpenCLContext * GetContext() const
Definition itkOpenCLProgram.h:71
itk::OpenCLProgram::OpenCLProgram
OpenCLProgram()
itk::OpenCLProgram::OpenCLProgram
OpenCLProgram(OpenCLContext *context, cl_program id, const std::string &fileName=std::string())
itk::OpenCLProgram::Build
bool Build(const std::list< OpenCLDevice > &devices, const std::string &extraBuildOptions=std::string())
itk::OpenCLProgram::Build
bool Build(const std::string &extraBuildOptions=std::string())
itk::OpenCLProgram::CreateKernels
std::list< OpenCLKernel > CreateKernels() const
itk::OpenCLProgram::Self
OpenCLProgram Self
Definition itkOpenCLProgram.h:41
itk::OpenCLProgram::m_FileName
std::string m_FileName
Definition itkOpenCLProgram.h:135
itk::OpenCLProgram::IsNull
bool IsNull() const
Definition itkOpenCLProgram.h:64
itk::OpenCLProgram::~OpenCLProgram
~OpenCLProgram()
itk::OpenCLProgram::operator=
OpenCLProgram & operator=(const OpenCLProgram &other)
itk::OpenCLProgram::GetProgramId
cl_program GetProgramId() const
Definition itkOpenCLProgram.h:78
itk::OpenCLProgram::GetDevices
std::list< OpenCLDevice > GetDevices() const
itkOpenCLDevice.h
ITKOpenCL_EXPORT
#define ITKOpenCL_EXPORT
Definition itkOpenCLExport.h:33
itkOpenCLKernel.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 |