Core

PlaidML Core

Initialization

void plaidml::init()

Initializes PlaidML’s Core API.

Note

Initialization of PlaidML’s Core Python API happens automatically wherever the module plaidml.core is imported.

Objects

enum core_objects::DType

Enumerates all of the data types in PlaidML.

Values:

INVALID = PLAIDML_DATA_INVALID
BOOLEAN = PLAIDML_DATA_BOOLEAN
INT8 = PLAIDML_DATA_INT8
UINT8 = PLAIDML_DATA_UINT8
INT16 = PLAIDML_DATA_INT16
UINT16 = PLAIDML_DATA_UINT16
INT32 = PLAIDML_DATA_INT32
UINT32 = PLAIDML_DATA_UINT32
INT64 = PLAIDML_DATA_INT64
UINT64 = PLAIDML_DATA_UINT64
BFLOAT16 = PLAIDML_DATA_BFLOAT16
FLOAT16 = PLAIDML_DATA_FLOAT16
FLOAT32 = PLAIDML_DATA_FLOAT32
FLOAT64 = PLAIDML_DATA_FLOAT64
class TensorShape

This is a TensorShape.

Public Functions

TensorShape()

TensorShape constructor

TensorShape(DType dtype, const std::vector<int64_t> &sizes)

TensorShape constructor

Parameters
  • dtype: DType

TensorShape(DType dtype, const std::vector<int64_t> &sizes, const std::vector<int64_t> &strides)

TensorShape constructor

Parameters
  • dtype: DType

  • sizes: const vector<int64_t>

  • strides: const vector<int64_t>

TensorShape(const std::shared_ptr<plaidml_shape> &ptr)

TensorShape constructor

Parameters
  • ptr: const shared_ptr<plaidml_shape>

DType dtype() const

dtype

Return

DType

size_t ndims() const

Returns the number of dimensions in the TensorShape

Return

size_t

uint64_t nbytes() const

nbytes

Return

uint64_t

class View

This is a View.

Public Functions

char *data()

data

size_t size()

size

void writeback()

writeback

class Buffer

This is a Buffer.

Public Functions

Buffer()

Buffer constructor

Buffer(const std::string &device, const TensorShape &shape)

Buffer constructor

Parameters

Buffer(plaidml_buffer *ptr, const TensorShape &shape)

Buffer constructor

Parameters

plaidml_buffer *as_ptr() const

Returns a pointer to the Buffer.

Return

plaidml_buffer*

View mmap_current()

mmap_current

Return

View

View mmap_discard()

mmap_discard

Return

View

struct Settings

These are the Settings.

Public Static Functions

static std::string get(const std::string &key)

Gets the setting specified by key

Return

string

Parameters
  • key: string

static void set(const std::string &key, const std::string &value)

Sets the setting specified by key to the value specified.

Parameters
  • key: string

  • value: string