18#ifndef itkOpenCLDevice_h
19#define itkOpenCLDevice_h
90 Accelerator = (1 << 3),
105 return this->m_Id == 0;
372 NotSupported = 0x0000,
374 InfinityNaN = 0x0002,
375 RoundNearest = 0x0004,
377 RoundInfinity = 0x0010,
378 FusedMultiplyAdd = 0x0020
514 std::list<std::string>
532 static std::list<OpenCLDevice>
539 static std::list<OpenCLDevice>
545 static std::list<OpenCLDevice>
575 static std::list<OpenCLDevice>
596template <
typename charT,
typename traits>
597inline std::basic_ostream<charT, traits> &
602 strm <<
"OpenCLDevice(null)";
606 const char indent =
' ';
608 strm <<
"OpenCLDevice\n" << indent <<
"Id: " << device.
GetDeviceId() << std::endl;
610 strm << indent <<
"OpenCL version: ";
633 strm <<
'\n' << indent <<
"Version: " << device.
GetVersion() << std::endl;
635 strm << indent <<
"Device type: ";
648 strm <<
"Accelerator";
660 << indent <<
"Vendor Id: " << device.
GetVendorId() <<
'\n'
661 << indent <<
"Available: " << (device.
IsAvailable() ?
"Yes" :
"No") <<
'\n'
662 << indent <<
"Has compiler: " << (device.
HasCompiler() ?
"Yes" :
"No") <<
'\n'
663 << indent <<
"Has native kernels: " << (device.
HasNativeKernels() ?
"Yes" :
"No") <<
'\n'
665 << indent <<
"Has double: " << (device.
HasDouble() ?
"Yes" :
"No") <<
'\n'
666 << indent <<
"Has half float: " << (device.
HasHalfFloat() ?
"Yes" :
"No") <<
'\n'
668 << indent <<
"Has unified memory: " << (device.
HasUnifiedMemory() ?
"Yes" :
"No") <<
'\n'
671 << indent <<
"Address bits: " << device.
GetAddressBits() << std::endl;
673 strm << indent <<
"Byte order: ";
677 strm <<
"Big Endian";
680 strm <<
"Little Endian";
694 strm << indent <<
"Has image 2D: " << (hasImage2D ?
"Yes" :
"No") << std::endl;
702 strm << indent <<
"Has image 3D: " << (hasImage3D ?
"Yes" :
"No") << std::endl;
708 strm << indent <<
"Has writable image 3D: " << (device.
HasWritableImage3D() ?
"Yes" :
"No") <<
'\n'
729 strm << indent <<
"Float capabilities: ";
733 strm <<
"Not supported";
739 strm <<
"Infinity nan";
742 strm <<
"Round nearest";
745 strm <<
"Round zero";
748 strm <<
"Round infinity";
751 strm <<
"Fused multiply add";
758 strm <<
'\n' << indent <<
"Double capabilities: ";
762 strm <<
"Not supported";
768 strm <<
"Infinity NaN";
771 strm <<
"Round nearest";
774 strm <<
"Round zero";
777 strm <<
"Round infinity";
780 strm <<
"Fused multiply add";
787 strm <<
'\n' << indent <<
"Half float capabilities: ";
791 strm <<
"Not supported";
797 strm <<
"Infinity NaN";
800 strm <<
"Round nearest";
803 strm <<
"Round zero";
806 strm <<
"Round infinity";
809 strm <<
"Fused multiply add";
821 strm << indent <<
"Global memory cache type: ";
828 strm <<
"Read only cache";
831 strm <<
"Read write cache";
848 << indent <<
"Full profile: " << (device.
IsFullProfile() ?
"Yes" :
"No") <<
'\n'
849 << indent <<
"Embedded profile: " << (device.
IsEmbeddedProfile() ?
"Yes" :
"No") <<
'\n'
850 << indent <<
"Profile: " << device.
GetProfile() <<
'\n'
852 << indent <<
"Name: " << device.
GetName() <<
'\n'
853 << indent <<
"Vendor: " << device.
GetVendor() <<
'\n'
856 const std::list<std::string> extensions = device.
GetExtensions();
857 const std::size_t extensionsSize = extensions.size();
858 strm << indent <<
"Extensions(" << extensionsSize <<
"): ";
859 if (extensionsSize == 0)
866 for (std::list<std::string>::const_iterator it = extensions.begin(); it != extensions.end(); ++it)
868 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)