Execution

PlaidML Execution

Initialization

void plaidml::exec::init()

Initializes PlaidML’s Execution API.

Note

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

Objects

struct Binding

Bindings bind a Tensor to a Buffer.

Public Members

edsl::Tensor tensor

The tensor to bind.

Buffer buffer

The buffer to be bound to.

class Executable

This is an Executable.

Public Functions

Executable(const edsl::Program &program, const std::vector<Binding> &inputs, const std::vector<Binding> &outputs)

Executable constructor

Executable(const edsl::Program &program, const std::string &device, const std::string &target, const std::vector<Binding> &inputs, const std::vector<Binding> &outputs)

Executable constructor

void run()

run

struct Binder

This is a Binder.

Public Functions

Binder(const edsl::Program &program)

Constructs a Binder. By default, this constructor uses the environment variables PLAIDML_DEVICE and PLAIDML_TARGET to specify your device and target. You can override these using the set_device and set_target functions

Binder &set_device(const std::string &value)

Set the device for the Binder to use.

Return

Binder

Parameters
  • value: string

Binder &set_target(const std::string &value)

Set the target for the Binder to use.

Return

Binder

Parameters
  • value: string

Buffer input(const edsl::Tensor &tensor)

input

Return

Buffer

Parameters
  • tensor: Tensor

Buffer output(const edsl::Tensor &tensor)

output

Return

Buffer

Parameters
  • tensor: Tensor

Binder &set_input(const edsl::Tensor &tensor, const Buffer &buffer)

set_input

Return

Binder

Parameters
  • tensor: Tensor

  • buffer: Buffer

Binder &set_output(const edsl::Tensor &tensor, const Buffer &buffer)

set_output

Return

Binder

Parameters
  • tensor: Tensor

  • buffer: Buffer

std::shared_ptr<Executable> compile()

compile

Return

shared_ptr<Executable>