Class DType#

Class Documentation#

class DType#

This class represents a data type specified by a TypeId.

Public Functions

DType(TypeId tid)#

Construct a DType for a given type specified by a TypeId.

Parameters:

tid – The TypeId to initialize the DType object with.

DType(const DType &dtype) = default#

Copy constructor.

Parameters:

dtype – The DType object to copy from.

bool operator==(const DType &other) const#

Equality operator.

Parameters:

other – The DType object to compare with.

Returns:

True if the two DType objects represent the same TypeId, false otherwise.

TypeId type_id() const#

Get the TypeId of the DType object.

Returns:

The TypeId of the DType object.

size_t item_size() const#

Get the number of bytes per item.

Returns:

The number of bytes per item.

std::string name() const#

Get the name of the DType object.

Returns:

The name of the DType object.

std::string type_str() const#

Get the numpy string representation of the DType object.

Returns:

The numpy string representation of the DType object.

std::string triton_str() const#

Get the triton string representation of the DType object.

Returns:

The triton string representation of the DType object.

bool is_fully_supported() const#

Check if the DType object is fully supported.

Returns:

True if the DType object is fully supported, false otherwise.

Public Static Functions

static DType from_cudf(cudf::type_id tid)#

Create a DType object from a cudf type id.

Parameters:

id – The cudf type id.

Returns:

A DType object.

static DType from_numpy(const std::string &numpy_str)#

Create a DType object from a numpy type string.

Parameters:

type_str – The numpy type string.

Returns:

A DType object.

static DType from_triton(const std::string &type_str)#

Create a DType object from a triton type string.

Parameters:

type_str – The triton type string.

Returns:

A DType object.

template<typename T>
static inline DType create()#

Construct a DType object from a C++ type.

Returns:

A DType object.