CLOGS
C++ library for sorting and searching in OpenCL applications
clogs::Type Class Reference

Encapsulation of an OpenCL built-in type that can be stored in a buffer. More...

#include <core.h>

Public Member Functions

 Type ()
 Default constructor, creating the void type.
 
 Type (BaseType baseType, unsigned int length=1)
 Constructor. More...
 
bool isStorable (const cl::Device &device) const
 Whether the type can be stored in a buffer and read/written in a CL C program using the assignment operator.
 
bool isComputable (const cl::Device &device) const
 Whether the type can be used in expressions.
 
bool isIntegral () const
 True if the type stores integer values.
 
bool isSigned () const
 True if the type is signed.
 
std::string getName () const
 Name of the CL C type.
 
::size_t getSize () const
 Size in bytes of the C API form of the type (0 for void)
 
::size_t getBaseSize () const
 Size in bytes of the scalar elements (0 for void)
 
BaseType getBaseType () const
 The scalar element type.
 
unsigned int getLength () const
 The vector length (1 for scalars, 0 for void).
 

Static Public Member Functions

static std::vector< TypeallTypes ()
 Returns a list of all supported types.
 

Detailed Description

Encapsulation of an OpenCL built-in type that can be stored in a buffer.

An instance of this class can represent either a scalar, a vector, or the void type.

Constructor & Destructor Documentation

clogs::Type::Type ( BaseType  baseType,
unsigned int  length = 1 
)

Constructor.

It is deliberately not declared explicit, so that an instance of BaseType can be used where Type is expected.

Precondition
baseType is not TYPE_VOID.

The documentation for this class was generated from the following file: