18#ifndef __itkOpenCLDevice_h
19#define __itkOpenCLDevice_h
84 Accelerator = ( 1 << 3 ),
95 bool IsNull()
const {
return this->m_Id == 0; }
315 NotSupported = 0x0000,
317 InfinityNaN = 0x0002,
318 RoundNearest = 0x0004,
320 RoundInfinity = 0x0010,
321 FusedMultiplyAdd = 0x0020
509template<
typename charT,
typename traits >
511std::basic_ostream< charT, traits > &
512operator<<( std::basic_ostream< charT, traits > & strm,
517 strm <<
"OpenCLDevice(null)";
521 const char indent =
' ';
523 strm <<
"OpenCLDevice" << std::endl
524 << indent <<
"Id: " << device.
GetDeviceId() << std::endl;
526 strm << indent <<
"OpenCL version: ";
530 strm <<
"1.0";
break;
532 strm <<
"1.1";
break;
534 strm <<
"1.2";
break;
536 strm <<
"2.0";
break;
538 strm <<
"2.1";
break;
540 strm <<
"Unknown";
break;
543 strm << std::endl << indent <<
"Version: " << device.
GetVersion() << std::endl;
545 strm << indent <<
"Device type: ";
549 strm <<
"Default";
break;
551 strm <<
"CPU";
break;
553 strm <<
"GPU";
break;
555 strm <<
"Accelerator";
break;
557 strm <<
"All";
break;
559 strm <<
"Unknown";
break;
563 strm << std::endl << indent <<
"Vendor Id: " << device.
GetVendorId() << std::endl
564 << indent <<
"Available: " << ( device.
IsAvailable() ?
"Yes" :
"No" ) << std::endl
565 << indent <<
"Has compiler: " << ( device.
HasCompiler() ?
"Yes" :
"No" ) << std::endl
566 << indent <<
"Has native kernels: " << ( device.
HasNativeKernels() ?
"Yes" :
"No" ) << std::endl
567 << indent <<
"Has out of order execution: " << ( device.
HasOutOfOrderExecution() ?
"Yes" :
"No" ) << std::endl
568 << indent <<
"Has double: " << ( device.
HasDouble() ?
"Yes" :
"No" ) << std::endl
569 << indent <<
"Has half float: " << ( device.
HasHalfFloat() ?
"Yes" :
"No" ) << std::endl
571 << indent <<
"Has unified memory: " << ( device.
HasUnifiedMemory() ?
"Yes" :
"No" ) << std::endl
572 << indent <<
"Compute units: " << device.
GetComputeUnits() << std::endl
574 << indent <<
"Address bits: " << device.
GetAddressBits() << std::endl;
576 strm << indent <<
"Byte order: ";
580 strm <<
"Big Endian";
break;
582 strm <<
"Little Endian";
break;
584 strm <<
"Unknown";
break;
593 strm << indent <<
"Has image 2D: " << ( hasImage2D ?
"Yes" :
"No" ) << std::endl;
601 strm << indent <<
"Has image 3D: " << ( hasImage3D ?
"Yes" :
"No" ) << std::endl;
607 strm << indent <<
"Has writable image 3D: " << ( device.
HasWritableImage3D() ?
"Yes" :
"No" ) << std::endl
628 strm << indent <<
"Float capabilities: ";
632 strm <<
"Not supported";
break;
634 strm <<
"Denorm";
break;
636 strm <<
"Infinity nan";
break;
638 strm <<
"Round nearest";
break;
640 strm <<
"Round zero";
break;
642 strm <<
"Round infinity";
break;
644 strm <<
"Fused multiply add";
break;
646 strm <<
"Unknown";
break;
649 strm << std::endl << indent <<
"Double capabilities: ";
653 strm <<
"Not supported";
break;
655 strm <<
"Denorm";
break;
657 strm <<
"Infinity NaN";
break;
659 strm <<
"Round nearest";
break;
661 strm <<
"Round zero";
break;
663 strm <<
"Round infinity";
break;
665 strm <<
"Fused multiply add";
break;
667 strm <<
"Unknown";
break;
670 strm << std::endl << indent <<
"Half float capabilities: ";
674 strm <<
"Not supported";
break;
676 strm <<
"Denorm";
break;
678 strm <<
"Infinity NaN";
break;
680 strm <<
"Round nearest";
break;
682 strm <<
"Round zero";
break;
684 strm <<
"Round infinity";
break;
686 strm <<
"Fused multiply add";
break;
688 strm <<
"Unknown";
break;
695 strm << indent <<
"Global memory cache type: ";
699 strm <<
"No cache";
break;
701 strm <<
"Read only cache";
break;
703 strm <<
"Read write cache";
break;
705 strm <<
"Unknown";
break;
711 << indent <<
"Local memory separated: " << ( device.
IsLocalMemorySeparate() ?
"Yes" :
"No" ) << std::endl
717 << indent <<
"Full profile: " << ( device.
IsFullProfile() ?
"Yes" :
"No" ) << std::endl
718 << indent <<
"Embedded profile: " << ( device.
IsEmbeddedProfile() ?
"Yes" :
"No" ) << std::endl
719 << indent <<
"Profile: " << device.
GetProfile() << std::endl
721 << indent <<
"Name: " << device.
GetName() << std::endl
722 << indent <<
"Vendor: " << device.
GetVendor() << std::endl
725 const std::list< std::string > extensions = device.
GetExtensions();
726 const std::size_t extensionsSize = extensions.size();
727 strm << indent <<
"Extensions(" << extensionsSize <<
"): ";
728 if( extensionsSize == 0 )
735 for( std::list< std::string >::const_iterator it = extensions.begin(); it != extensions.end(); ++it )
737 strm << indent << indent <<
"- " << *it << std::endl;
The OpenCLDevice class represents the collection of OpenCL devices to be used by the host.
bool HasHalfFloat() const
cl_device_id GetDeviceId() const
bool IsLocalMemorySeparate() const
unsigned int GetNativeDoubleVectorSize() const
bool IsFullProfile() const
static std::list< OpenCLDevice > GetDevices(const OpenCLDevice::DeviceType type, const OpenCLPlatform::VendorType vendor)
OpenCLDevice::DeviceType GetDeviceType() const
static OpenCLDevice GetMaximumFlopsDeviceByVendor(const OpenCLDevice::DeviceType type, const OpenCLPlatform::VendorType vendor)
std::string GetName() const
unsigned long GetGlobalMemorySize() const
unsigned int GetPreferredDoubleVectorSize() const
unsigned int GetClockFrequency() const
OpenCLVersion GetOpenCLVersion() const
unsigned int GetNativeFloatVectorSize() const
OpenCLPlatform GetPlatform() const
bool HasErrorCorrectingMemory() const
FloatCapability GetHalfFloatCapabilities() const
unsigned int GetNativeCharVectorSize() const
OpenCLSize GetMaximumWorkItemSize() const
bool IsEmbeddedProfile() const
static OpenCLDevice GetMaximumFlopsDevice(const OpenCLDevice::DeviceType type)
std::string GetLanguageVersion() const
unsigned int GetDefaultAlignment() const
unsigned int GetVendorId() const
FloatCapability GetDoubleCapabilities() const
unsigned int GetComputeUnits() const
OpenCLDevice(cl_device_id id)
std::vcl_size_t GetMaximumWorkItemsPerGroup() const
unsigned int GetPreferredHalfFloatVectorSize() const
bool HasWritableImage3D() const
unsigned int GetMaximumConstantArguments() const
FloatCapability GetFloatCapabilities() const
bool HasOutOfOrderExecution() const
unsigned int GetPreferredShortVectorSize() const
static std::list< OpenCLDevice > GetAllDevices()
std::vcl_size_t GetMaximumParameterBytes() const
bool HasUnifiedMemory() const
unsigned int GetNativeLongVectorSize() const
static OpenCLDevice GetMaximumFlopsDevice(const std::list< OpenCLDevice > &devices, const OpenCLDevice::DeviceType type)
static OpenCLDevice GetMaximumFlopsDeviceByPlatform(const OpenCLDevice::DeviceType types, const OpenCLPlatform &platform=OpenCLPlatform())
unsigned int GetGlobalMemoryCacheLineSize() const
CacheType GetGlobalMemoryCacheType() const
OpenCLSize GetMaximumImage3DSize() const
std::vcl_size_t GetProfilingTimerResolution() const
unsigned long GetMaximumConstantBufferSize() const
bool HasExtension(const std::string &name) const
unsigned int GetNativeHalfFloatVectorSize() const
OpenCLSize GetMaximumImage2DSize() const
std::string GetDriverVersion() const
static std::list< OpenCLDevice > GetDevices(const OpenCLDevice::DeviceType types, const OpenCLPlatform &platform=OpenCLPlatform())
static std::list< OpenCLDevice > GetMaximumFlopsDevices(const OpenCLDevice::DeviceType type, const OpenCLPlatform &platform=OpenCLPlatform())
unsigned int GetPreferredLongVectorSize() const
bool HasNativeKernels() const
unsigned int GetNativeShortVectorSize() const
unsigned int GetMinimumAlignment() const
unsigned int GetNativeIntVectorSize() const
unsigned int GetPreferredCharVectorSize() const
unsigned int GetPreferredFloatVectorSize() const
unsigned int GetMaximumSamplers() const
std::list< std::string > GetExtensions() const
unsigned int GetMaximumWriteImages() const
unsigned int GetPreferredIntVectorSize() const
unsigned long GetMaximumAllocationSize() const
std::string GetProfile() const
unsigned int GetAddressBits() const
unsigned int GetMaximumReadImages() const
std::string GetVendor() const
std::string GetVersion() const
unsigned long GetLocalMemorySize() const
OpenCLDevice::Endian GetByteOrder() const
unsigned long GetGlobalMemoryCacheSize() const
The OpenCLSize class defines the size of an item of work for an OpenCL kernel.
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)