Skip to content

tenzr::ExecutionResult

Result of executing a graph, holding device-resident buffers plus lazily materialized host storage for its outputs.

#include <execution_engine.h>

Public Functions

Name
void EnsureHostBuffer() const
Materialize the pinned host buffer from the device buffer when not already staged.
template <typenameT >
std::vector< T >
ToVector() const
Array AsArray(std::string name ="") const
Array AsTensor(std::string name ="") const
Alias for as_array.
operator Array() const

Public Attributes

Name
std::shared_ptr< DeviceBuffer > device_buffer
Device-resident buffer holding the result.
std::shared_ptr< PinnedBuffer > output_buffer
Shape shape
DType dtype
constPJRT_Api * api
std::vector< std::shared_ptr< DeviceBuffer > > device_buffers
All device-resident outputs; index 0 mirrors device_buffer.
std::vector< Shape > shapes
Shapes of every output; mirrors the executable's out_shapes.
std::vector< DType > dtypes
DTypes of every output.

Public Functions Documentation

function EnsureHostBuffer

void EnsureHostBuffer() const

Materialize the pinned host buffer from the device buffer when not already staged.

Lazily copy the device output into a pooled host buffer.

function ToVector

template <typenameT >
inline std::vector< T > ToVector() const

Template Parameters:

  • T Requested element type; must match the result dtype.

Return: Host vector containing the result elements.

Copy the result into a host std::vector.

function AsArray

Array AsArray(
    std::string name =""
) const

Parameters:

  • name Symbolic name for the resulting Array.
  • name Name assigned to the produced variable.

Return:

  • An Array view of the result.
  • Array referencing the execution result.

Wrap the result as an Array bound to an optional name. Wrap the result in an Array variable node carrying the device and/or host buffer.

function AsTensor

inline Array AsTensor(
    std::string name =""
) const

Alias for as_array.

function operator Array

inline operator Array() const

Public Attributes Documentation

variable device_buffer

std::shared_ptr< DeviceBuffer > device_buffer;

Device-resident buffer holding the result.

variable output_buffer

std::shared_ptr< PinnedBuffer > output_buffer;

variable shape

Shape shape;

variable dtype

DType dtype;

variable api

constPJRT_Api * api {nullptr};

variable device_buffers

std::vector< std::shared_ptr< DeviceBuffer > > device_buffers;

All device-resident outputs; index 0 mirrors device_buffer.

variable shapes

std::vector< Shape > shapes;

Shapes of every output; mirrors the executable's out_shapes.

variable dtypes

std::vector< DType > dtypes;

DTypes of every output.