18 #ifndef __itkOpenCLPlatform_h 19 #define __itkOpenCLPlatform_h 74 bool IsNull()
const {
return this->m_Id == 0; }
86 std::string GetVersion()
const;
90 bool IsFullProfile()
const;
94 bool IsEmbeddedProfile()
const;
99 std::string GetProfile()
const;
102 std::string GetName()
const;
105 std::string GetVendor()
const;
113 std::string GetExtensionSuffix()
const;
117 std::list< std::string > GetExtensions()
const;
125 bool HasExtension(
const std::string & name )
const;
128 static std::list< OpenCLPlatform > GetAllPlatforms();
150 template<
typename charT,
typename traits >
152 std::basic_ostream< charT, traits > &
153 operator<<( std::basic_ostream< charT, traits > & strm,
156 if( platform.IsNull() )
158 strm <<
"OpenCLPlatform(null)";
162 const char indent =
' ';
164 strm <<
"OpenCLPlatform" << std::endl
165 << indent <<
"Id: " << platform.
GetPlatformId() << std::endl;
167 strm << indent <<
"OpenCL version: ";
168 switch( platform.GetOpenCLVersion() )
171 strm <<
"1.0";
break;
173 strm <<
"1.1";
break;
175 strm <<
"1.2";
break;
177 strm <<
"2.0";
break;
179 strm <<
"2.1";
break;
181 strm <<
"Unknown";
break;
184 strm << std::endl << indent <<
"Full profile: " << ( platform.IsFullProfile() ?
"On" :
"Off" ) << std::endl
185 << indent <<
"Embedded profile: " << ( platform.IsEmbeddedProfile() ?
"On" :
"Off" ) << std::endl
186 << indent <<
"Profile: " << platform.GetProfile() << std::endl
187 << indent <<
"Version: " << platform.GetVersion() << std::endl
188 << indent <<
"Name: " << platform.GetName() << std::endl
189 << indent <<
"Vendor: " << platform.GetVendor() << std::endl
190 << indent <<
"Extension suffix: " << platform.GetExtensionSuffix() << std::endl;
192 const std::list< std::string > extensions = platform.GetExtensions();
193 const std::size_t extensionsSize = extensions.size();
194 strm << indent <<
"Extensions(" << extensionsSize <<
"): ";
195 if( extensions.empty() )
202 for( std::list< std::string >::const_iterator it = extensions.begin(); it != extensions.end(); ++it )
204 strm << indent << indent <<
"- " << *it << std::endl;
bool ITKOpenCL_EXPORT operator==(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)
bool ITKOpenCL_EXPORT operator!=(const OpenCLCommandQueue &lhs, const OpenCLCommandQueue &rhs)