Scenario Runner Python API Reference

Warning

The Scenario Runner Python API is currently experimental and subject to change, including incompatible changes, in future releases.

The Python API is provided by the scenario_runner_py extension module. It supports both loading existing JSON scenarios and constructing scenarios programmatically. Resource uploads and downloads use C-contiguous NumPy arrays.

Build and import the bindings

Build the bindings from a Scenario Runner source checkout:

python3 scripts/build.py --build-pylib

The extension is written to build/src by default. Add that directory to PYTHONPATH when running a Python application, or configure your IDE to use it. From the source checkout:

export PYTHONPATH="$PWD/build/src${PYTHONPATH:+:$PYTHONPATH}"

Then import the module:

import scenario_runner_py as sr

Python examples

Load a JSON scenario, replace an input buffer, and retrieve an output buffer:

# SPDX-FileCopyrightText: Copyright 2026 Arm Limited and/or its affiliates <open-source-office@arm.com>
# SPDX-License-Identifier: Apache-2.0
from pathlib import Path

import numpy as np
import scenario_runner_py as sr

sample_dir = Path(__file__).resolve().parent.parent
scenario = sr.load_scenario(sample_dir / "increment.json", work_dir=sample_dir)
input_id = scenario.get_buffer_id("input")
output_id = scenario.get_buffer_id("output")

input_values = np.array([10, 20, 30, 40], dtype=np.uint32)
scenario.upload(input_id, input_values)
scenario.run()

# Buffer downloads contain bytes; view them using the data type used by the shader.
output_values = scenario.download(output_id).view(np.uint32)
np.testing.assert_array_equal(output_values, input_values + 1)

For a programmatic scenario, create resources with a builder and retain the returned IDs for subsequent transfer operations:

# SPDX-FileCopyrightText: Copyright 2026 Arm Limited and/or its affiliates <open-source-office@arm.com>
# SPDX-License-Identifier: Apache-2.0
from pathlib import Path

import numpy as np
import scenario_runner_py as sr

sample_dir = Path(__file__).resolve().parent.parent
builder = sr.ScenarioBuilder()

shader = sr.ShaderInfo()
shader.debug_name = "increment"
shader.entry = "main"
shader.shader_type = sr.ShaderType.Glsl
shader.stage = sr.ShaderStage.Compute
shader.load_source(str(sample_dir / "increment.comp"))
shader_id = builder.add_shader(shader)

input_id = builder.add_buffer(16, debug_name="input")
output_id = builder.add_buffer(16, debug_name="output")

dispatch = sr.DispatchComputeData(shader_id)
dispatch.debug_name = "increment"
dispatch.bindings = [
    sr.TypedBinding(0, 0, input_id, sr.DescriptorType.StorageBuffer),
    sr.TypedBinding(0, 1, output_id, sr.DescriptorType.StorageBuffer),
]
dispatch.compute_dispatch.group_count_x = 4
dispatch.compute_dispatch.profile_name = dispatch.debug_name
builder.add_dispatch_compute(dispatch)

scenario = builder.build()
input_values = np.array([1, 2, 3, 4], dtype=np.uint32)
scenario.upload(input_id, input_values)
scenario.run()

output_values = scenario.download(output_id).view(np.uint32)
np.testing.assert_array_equal(output_values, input_values + 1)

Python entry points

API

Purpose

load_scenario()

Load and build an existing JSON scenario file.

ScenarioJsonFactory

Class-based form of the JSON loading API.

ScenarioBuilder

Register resources and commands programmatically.

Scenario

Upload NumPy inputs, execute commands, and download NumPy outputs.

Scenario creation and execution

scenario_runner_py.load_scenario(scenario_file: os.PathLike | str | bytes, *, work_dir: os.PathLike | str | bytes = Path('.'), output_dir: os.PathLike | str | bytes = Path('.'), options: scenario_runner_py.ScenarioOptions = ScenarioOptions()) → scenario_runner_py.Scenario

Load a JSON scenario and return a ready-to-run Scenario.

Relative resource paths use the scenario file’s parent directory unless work_dir is supplied.

class scenario_runner_py.ScenarioJsonFactory

Create scenarios from JSON descriptions.

static make(scenario_file: os.PathLike | str | bytes, *, work_dir: os.PathLike | str | bytes = Path('.'), output_dir: os.PathLike | str | bytes = Path('.'), options: scenario_runner_py.ScenarioOptions = ScenarioOptions()) → scenario_runner_py.Scenario

Load a JSON scenario and return a ready-to-run Scenario.

class scenario_runner_py.Scenario

A built scenario that owns runtime resources and commands. It can be run repeatedly.

download()

Overloaded function.

1. download(self: scenario_runner_py.Scenario, id: scenario_runner_py.BufferId) -> numpy.ndarray

Return the buffer contents as a uint8 NumPy array.

2. download(self: scenario_runner_py.Scenario, id: scenario_runner_py.TensorId) -> numpy.ndarray

Return tensor contents as a NumPy array derived from its format.

3. download(self: scenario_runner_py.Scenario, id: scenario_runner_py.ImageId) -> numpy.ndarray

Return image contents as a NumPy array derived from its format. Multi-component images use a packed dtype.

get_buffer_id(self: scenario_runner_py.Scenario, uid: str) → scenario_runner_py.BufferId

Return the buffer ID associated with a JSON resource UID.

get_image_id(self: scenario_runner_py.Scenario, uid: str) → scenario_runner_py.ImageId

Return the image ID associated with a JSON resource UID.

get_tensor_id(self: scenario_runner_py.Scenario, uid: str) → scenario_runner_py.TensorId

Return the tensor ID associated with a JSON resource UID.

run(self: scenario_runner_py.Scenario, *, repeat_count: SupportsInt | SupportsIndex = 1, dry_run: bool = False) → None

Execute the command sequence.

upload()

Overloaded function.

1. upload(self: scenario_runner_py.Scenario, id: scenario_runner_py.BufferId, data: numpy.ndarray) -> None

Copy a C-contiguous NumPy array into the buffer selected by id.

2. upload(self: scenario_runner_py.Scenario, id: scenario_runner_py.TensorId, data: numpy.ndarray) -> None

Copy a C-contiguous NumPy array into the tensor selected by id.

3. upload(self: scenario_runner_py.Scenario, id: scenario_runner_py.ImageId, data: numpy.ndarray) -> None

Copy one mip level from a C-contiguous NumPy array into the image selected by id.

Scenario builder

class scenario_runner_py.ScenarioBuilder

Define resources and commands, then build a Scenario.

add_buffer_barrier(self: scenario_runner_py.ScenarioBuilder, info: scenario_runner_py.BufferBarrierInfo) → scenario_runner_py.BufferBarrierId

Register a BufferBarrierInfo and return its barrier ID.

add_dispatch_compute(self: scenario_runner_py.ScenarioBuilder, command: scenario_runner_py.DispatchComputeData) → None

Append a DispatchComputeData command.

add_dispatch_data_graph(self: scenario_runner_py.ScenarioBuilder, command: scenario_runner_py.DispatchDataGraphData) → None

Append a DispatchDataGraphData command.

add_dispatch_data_graph_binary(self: scenario_runner_py.ScenarioBuilder, command: scenario_runner_py.DispatchDataGraphBinaryData) → None

Append a DispatchDataGraphBinaryData command.

add_dispatch_fragment(self: scenario_runner_py.ScenarioBuilder, command: scenario_runner_py.DispatchFragmentData) → None

Append a DispatchFragmentData command.

add_dispatch_optical_flow(self: scenario_runner_py.ScenarioBuilder, command: scenario_runner_py.DispatchOpticalFlowData) → None

Append a DispatchOpticalFlowData command.

add_dispatch_vgf(self: scenario_runner_py.ScenarioBuilder, command: scenario_runner_py.DispatchVgfData) → None

Append a DispatchVgfData command.

add_frame_boundary(self: scenario_runner_py.ScenarioBuilder, command: scenario_runner_py.FrameBoundaryData) → None

Append a FrameBoundaryData command.

add_graph_constant(self: scenario_runner_py.ScenarioBuilder, info: scenario_runner_py.GraphConstantInfo) → scenario_runner_py.GraphConstantResourceId

Register GraphConstantInfo and return its ID.

add_image_barrier(self: scenario_runner_py.ScenarioBuilder, info: scenario_runner_py.ImageBarrierInfo) → scenario_runner_py.ImageBarrierId

Register an ImageBarrierInfo and return its barrier ID.

add_memory_barrier(self: scenario_runner_py.ScenarioBuilder, info: scenario_runner_py.MemoryBarrierInfo) → scenario_runner_py.MemoryBarrierId

Register a MemoryBarrierInfo and return its barrier ID.

add_pipeline_barrier(self: scenario_runner_py.ScenarioBuilder, command: scenario_runner_py.PipelineBarrierData) → None

Append a PipelineBarrierData command.

add_raw_data(self: scenario_runner_py.ScenarioBuilder, info: scenario_runner_py.RawDataInfo) → scenario_runner_py.RawDataId

Register RawDataInfo and return its ID.

add_resource_to_memory_group(self: scenario_runner_py.ScenarioBuilder, group: scenario_runner_py.MemoryGroupId, resource: object) → None

Add a buffer, image, or tensor ID to an existing aliasing group.

add_shader(self: scenario_runner_py.ScenarioBuilder, info: scenario_runner_py.ShaderInfo) → scenario_runner_py.ShaderId

Register ShaderInfo and return its ID.

add_tensor_barrier(self: scenario_runner_py.ScenarioBuilder, info: scenario_runner_py.TensorBarrierInfo) → scenario_runner_py.TensorBarrierId

Register a TensorBarrierInfo and return its barrier ID.

add_vgf(self: scenario_runner_py.ScenarioBuilder, info: scenario_runner_py.VgfInfo) → scenario_runner_py.VgfId

Register VgfInfo and return its ID.

build(self: scenario_runner_py.ScenarioBuilder, *, options: scenario_runner_py.ScenarioOptions = ScenarioOptions()) → scenario_runner_py.Scenario

Consume the builder and return a ready-to-run Scenario. The builder cannot be reused.

create_memory_group(self: scenario_runner_py.ScenarioBuilder) → scenario_runner_py.MemoryGroupId

Create an aliasing group and return its ID.

Resource creation

The resource methods accept either a resource description object or convenience arguments. Both forms return the corresponding typed ID.

ScenarioBuilder.add_buffer()

Overloaded function.

1. add_buffer(self: scenario_runner_py.ScenarioBuilder, info: scenario_runner_py.BufferInfo) -> scenario_runner_py.BufferId

Register a buffer and return its ID.

2. add_buffer(self: scenario_runner_py.ScenarioBuilder, size: typing.SupportsInt | typing.SupportsIndex, *, debug_name: str = '', memory_offset: typing.SupportsInt | typing.SupportsIndex = 0) -> scenario_runner_py.BufferId

Register a buffer and return its ID.

ScenarioBuilder.add_image()

Overloaded function.

1. add_image(self: scenario_runner_py.ScenarioBuilder, info: scenario_runner_py.ImageInfo) -> scenario_runner_py.ImageId

Register an image and return its ID.

2. add_image(self: scenario_runner_py.ScenarioBuilder, shape: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex], format: scenario_runner_py.Format, *, debug_name: str = '', is_input: bool = False, is_sampled: bool = False, is_storage: bool = False, is_color_attachment: bool = False, mips: typing.SupportsInt | typing.SupportsIndex = 1, tiling: scenario_runner_py.Tiling | None = None, memory_offset: typing.SupportsInt | typing.SupportsIndex = 0) -> scenario_runner_py.ImageId

Register an image and return its ID. The convenience overload uses format as both source and target format.

ScenarioBuilder.add_tensor()

Overloaded function.

1. add_tensor(self: scenario_runner_py.ScenarioBuilder, info: scenario_runner_py.TensorInfo) -> scenario_runner_py.TensorId

Register a tensor and return its ID.

2. add_tensor(self: scenario_runner_py.ScenarioBuilder, shape: collections.abc.Sequence[typing.SupportsInt | typing.SupportsIndex], format: scenario_runner_py.Format, *, debug_name: str = '', sparsity_dimension: typing.SupportsInt | typing.SupportsIndex = -1, descriptor_buffer_capture_replay: bool = False, tiling: scenario_runner_py.Tiling = <Tiling.Linear: 1>, memory_offset: typing.SupportsInt | typing.SupportsIndex = 0) -> scenario_runner_py.TensorId

Register a tensor and return its ID.

Python resource identifiers

Typed IDs are immutable and hashable. They are created by the methods below, not constructed directly. The value property exposes the underlying numeric identifier for inspection or debugging; it is meaningful only within its scenario.

Type

Identifies

Created by

BufferId

A buffer

add_buffer() or get_buffer_id()

ImageId

An image

add_image() or get_image_id()

TensorId

A tensor

add_tensor() or get_tensor_id()

ShaderId

Shader data

add_shader()

RawDataId

Raw binary data

add_raw_data()

VgfId

A VGF

add_vgf()

GraphConstantResourceId

A graph constant

add_graph_constant()

MemoryGroupId

A memory aliasing group

create_memory_group()

ImageBarrierId

An image barrier

add_image_barrier()

BufferBarrierId

A buffer barrier

add_buffer_barrier()

TensorBarrierId

A tensor barrier

add_tensor_barrier()

MemoryBarrierId

A memory barrier

add_memory_barrier()

class scenario_runner_py.BufferId

An immutable, hashable typed resource ID scoped to a scenario.

property value
Type:

int

Return the numeric identifier, which is meaningful only within its scenario.

Read-only.

class scenario_runner_py.ImageId

An immutable, hashable typed resource ID scoped to a scenario.

property value
Type:

int

Return the numeric identifier, which is meaningful only within its scenario.

Read-only.

class scenario_runner_py.TensorId

An immutable, hashable typed resource ID scoped to a scenario.

property value
Type:

int

Return the numeric identifier, which is meaningful only within its scenario.

Read-only.

class scenario_runner_py.ShaderId

An immutable, hashable typed resource ID scoped to a scenario.

property value
Type:

int

Return the numeric identifier, which is meaningful only within its scenario.

Read-only.

class scenario_runner_py.RawDataId

An immutable, hashable typed resource ID scoped to a scenario.

property value
Type:

int

Return the numeric identifier, which is meaningful only within its scenario.

Read-only.

class scenario_runner_py.VgfId

An immutable, hashable typed resource ID scoped to a scenario.

property value
Type:

int

Return the numeric identifier, which is meaningful only within its scenario.

Read-only.

class scenario_runner_py.GraphConstantResourceId

An immutable, hashable typed resource ID scoped to a scenario.

property value
Type:

int

Return the numeric identifier, which is meaningful only within its scenario.

Read-only.

class scenario_runner_py.MemoryGroupId

An immutable, hashable typed resource ID scoped to a scenario.

property value
Type:

int

Return the numeric identifier, which is meaningful only within its scenario.

Read-only.

class scenario_runner_py.ImageBarrierId

An immutable, hashable typed resource ID scoped to a scenario.

property value
Type:

int

Return the numeric identifier, which is meaningful only within its scenario.

Read-only.

class scenario_runner_py.BufferBarrierId

An immutable, hashable typed resource ID scoped to a scenario.

property value
Type:

int

Return the numeric identifier, which is meaningful only within its scenario.

Read-only.

class scenario_runner_py.TensorBarrierId

An immutable, hashable typed resource ID scoped to a scenario.

property value
Type:

int

Return the numeric identifier, which is meaningful only within its scenario.

Read-only.

class scenario_runner_py.MemoryBarrierId

An immutable, hashable typed resource ID scoped to a scenario.

property value
Type:

int

Return the numeric identifier, which is meaningful only within its scenario.

Read-only.

Resource descriptions

The following classes have default constructors and writable attributes. The convenience overloads on scenario_runner_py.ScenarioBuilder avoid constructing the buffer, image, and tensor descriptions directly.

class scenario_runner_py.BufferInfo
property debug_name
Type:

str

Writable.

property memory_offset
Type:

int

Writable.

property size
Type:

int

Writable.

class scenario_runner_py.ImageInfo
property debug_name
Type:

str

Writable.

property format
Type:

Format

Writable.

property is_color_attachment
Type:

bool

Writable.

property is_input
Type:

bool

Writable.

property is_sampled
Type:

bool

Writable.

property is_storage
Type:

bool

Writable.

property memory_offset
Type:

int

Writable.

property mips
Type:

int

Writable.

property sampler_settings
Type:

SamplerSettings

Writable.

property shape
Type:

list[int]

Writable.

property target_format
Type:

Format

Writable.

property tiling
Type:

Tiling | None

Writable.

class scenario_runner_py.TensorInfo
property debug_name
Type:

str

Writable.

property descriptor_buffer_capture_replay
Type:

bool

Writable.

property format
Type:

Format

Writable.

property memory_offset
Type:

int

Writable.

property shape
Type:

list[int]

Writable.

property sparsity_dimension
Type:

int

Writable.

property tiling
Type:

Tiling

Writable.

class scenario_runner_py.SamplerSettings
property address_mode_u
Type:

AddressMode

Writable.

property address_mode_v
Type:

AddressMode

Writable.

property address_mode_w
Type:

AddressMode

Writable.

property border_color
Type:

BorderColor

Writable.

property custom_border_color
Type:

tuple[float, float, float, float] | tuple[int, int, int, int]

Writable.

property mag_filter
Type:

FilterMode

Writable.

property min_filter
Type:

FilterMode

Writable.

property mip_filter
Type:

FilterMode

Writable.

class scenario_runner_py.RawDataInfo
property debug_name
Type:

str

Writable.

property src
Type:

str

Writable.

class scenario_runner_py.ShaderInfo
property build_options
Type:

str

Writable.

property debug_name
Type:

str

Writable.

property entry
Type:

str

Writable.

property include_dirs
Type:

list[str]

Writable.

load_source(self: scenario_runner_py.ShaderInfo, path: str) → None

Load or compile a shader file into src.

property push_constants_size
Type:

int

Writable.

property shader_type
Type:

ShaderType

Writable.

property specialization_constants
Type:

list[SpecializationConstant]

Writable.

property src
Type:

list[int] | None

Writable.

property stage
Type:

ShaderStage

Writable.

class scenario_runner_py.VgfInfo
property debug_name
Type:

str

Writable.

load_source(self: scenario_runner_py.VgfInfo, path: str) → None

Load a VGF file into src.

property push_constants_size
Type:

int

Writable.

property specialization_constant_maps
Type:

list[SpecializationConstantMap]

Writable.

class scenario_runner_py.GraphConstantInfo
property data
Type:

list[int]

Writable.

property debug_name
Type:

str

Writable.

property dims
Type:

list[int]

Writable.

property format
Type:

Format

Writable.

class scenario_runner_py.SpecializationConstant
static from_float32(id: SupportsInt | SupportsIndex, value: SupportsFloat | SupportsIndex) → scenario_runner_py.SpecializationConstant
static from_int32(id: SupportsInt | SupportsIndex, value: SupportsInt | SupportsIndex) → scenario_runner_py.SpecializationConstant
static from_uint32(id: SupportsInt | SupportsIndex, value: SupportsInt | SupportsIndex) → scenario_runner_py.SpecializationConstant
property id
Type:

int

Writable.

Use from_int32(), from_uint32(), or from_float32() to construct a value.

class scenario_runner_py.SpecializationConstantMap
property shader_target
Type:

str

Writable.

property specialization_constants
Type:

list[SpecializationConstant]

Writable.

Python bindings and commands

class scenario_runner_py.TypedBinding(set: SupportsInt | SupportsIndex, binding: SupportsInt | SupportsIndex, resource: object, descriptor_type: scenario_runner_py.DescriptorType, *, lod: SupportsInt | SupportsIndex | None = None)
property binding
Type:

int

Writable.

property descriptor_type
Type:

DescriptorType

Writable.

property lod
Type:

int | None

Writable.

property resource
Type:

BufferId | ImageId | TensorId

Writable.

property set
Type:

int

Writable.

class scenario_runner_py.ComputeDispatch
property group_count_x
Type:

int

Writable.

property group_count_y
Type:

int

Writable.

property group_count_z
Type:

int

Writable.

property profile_name
Type:

str

Writable.

class scenario_runner_py.DispatchComputeData(shader: scenario_runner_py.ShaderId)
property bindings
Type:

list[TypedBinding]

Writable.

property compute_dispatch
Type:

ComputeDispatch

Writable.

property debug_name
Type:

str

Writable.

property implicit_barrier
Type:

bool

Writable.

property push_data
Type:

RawDataId | None

Writable.

property shader
Type:

ShaderId

Writable.

class scenario_runner_py.FragmentAttachment(resource: scenario_runner_py.ImageId, *, lod: SupportsInt | SupportsIndex | None = None)
property lod
Type:

int | None

Writable.

property resource
Type:

ImageId

Writable.

class scenario_runner_py.Extent2D(arg0: SupportsInt | SupportsIndex, arg1: SupportsInt | SupportsIndex)
property height
Type:

int

Writable.

property width
Type:

int

Writable.

class scenario_runner_py.DispatchFragmentData(vertex_shader: scenario_runner_py.ShaderId, fragment_shader: scenario_runner_py.ShaderId)
property bindings
Type:

list[TypedBinding]

Writable.

property color_attachments
Type:

list[FragmentAttachment]

Writable.

property debug_name
Type:

str

Writable.

property fragment_shader
Type:

ShaderId

Writable.

property implicit_barrier
Type:

bool

Writable.

property push_data
Type:

RawDataId | None

Writable.

property render_extent
Type:

Extent2D | None

Writable.

property vertex_shader
Type:

ShaderId

Writable.

class scenario_runner_py.PushConstantMap(push_data: scenario_runner_py.RawDataId, shader_target: str)
property push_data
Type:

RawDataId

Writable.

property shader_target
Type:

str

Writable.

class scenario_runner_py.ShaderSubstitution(shader: scenario_runner_py.ShaderId, target: str)
property shader
Type:

ShaderId

Writable.

property target
Type:

str

Writable.

class scenario_runner_py.ExternalDataGraphBinary(binary: scenario_runner_py.RawDataId)
property binary
Type:

RawDataId

Writable.

property pipeline_identifier
Type:

list[int] | None

Writable.

property use_application_storage
Type:

bool

Writable.

class scenario_runner_py.DispatchVgfData(vgf: scenario_runner_py.VgfId)
property bindings
Type:

list[TypedBinding]

Writable.

property debug_name
Type:

str

Writable.

property implicit_barrier
Type:

bool

Writable.

property push_constants
Type:

list[PushConstantMap]

Writable.

property shader_substitutions
Type:

list[ShaderSubstitution]

Writable.

property vgf
Type:

VgfId

Writable.

class scenario_runner_py.DispatchDataGraphBinaryData(binary: scenario_runner_py.RawDataId)

Describe a standalone precompiled graph dispatch.

property binary_data
Type:

ExternalDataGraphBinary

Writable.

property bindings
Type:

list[TypedBinding]

Writable.

property debug_name
Type:

str

Writable.

property implicit_barrier
Type:

bool

Writable.

class scenario_runner_py.DispatchDataGraphData(graph_shader: scenario_runner_py.ShaderId)

Describe a dispatch of a SPIR-V graph shader.

Create a dispatch for graph_shader.

property bindings
Type:

list[TypedBinding]

Resource bindings used by the graph shader.

Writable.

property debug_name
Type:

str

Optional name used in diagnostics.

Writable.

property graph_constants
Type:

list[GraphConstantResourceId]

Graph constants applied to the dispatch.

Writable.

property graph_shader
Type:

ShaderId

The graph shader to dispatch.

Writable.

property implicit_barrier
Type:

bool

Whether to insert the default synchronization barrier.

Writable.

class scenario_runner_py.DispatchOpticalFlowData(search: scenario_runner_py.TypedBinding, reference: scenario_runner_py.TypedBinding, output: scenario_runner_py.TypedBinding)
property debug_name
Type:

str

Writable.

property execution_flags
Type:

int

Writable.

property grid_size
Type:

OpticalFlowGridSize

Writable.

property height
Type:

int

Writable.

property hint_motion_vectors
Type:

TypedBinding | None

Writable.

property implicit_barrier
Type:

bool

Writable.

property mean_flow_l1_norm_hint
Type:

int

Writable.

property output_cost
Type:

TypedBinding | None

Writable.

property output_image
Type:

TypedBinding

Writable.

property performance_level
Type:

OpticalFlowPerformanceLevel

Writable.

property search_image
Type:

TypedBinding

Writable.

property template_image
Type:

TypedBinding

Writable.

property width
Type:

int

Writable.

class scenario_runner_py.PipelineBarrierData
property buffer_barriers
Type:

list[BufferBarrierId]

Writable.

property image_barriers
Type:

list[ImageBarrierId]

Writable.

property memory_barriers
Type:

list[MemoryBarrierId]

Writable.

property tensor_barriers
Type:

list[TensorBarrierId]

Writable.

class scenario_runner_py.FrameBoundaryData
property buffers
Type:

list[BufferId]

Writable.

property images
Type:

list[ImageId]

Writable.

property tensors
Type:

list[TensorId]

Writable.

Python barriers

class scenario_runner_py.BaseBarrierInfo
property debug_name
Type:

str

Writable.

property dst_access
Type:

MemoryAccess

Writable.

property dst_stages
Type:

list[PipelineStage]

Writable.

property src_access
Type:

MemoryAccess

Writable.

property src_stages
Type:

list[PipelineStage]

Writable.

class scenario_runner_py.SubresourceRange
property base_array_layer
Type:

int

Writable.

property base_mip_level
Type:

int

Writable.

property layer_count
Type:

int

Writable.

property level_count
Type:

int

Writable.

class scenario_runner_py.ImageBarrierInfo
property image
Type:

ImageId

Writable.

property new_layout
Type:

ImageLayout

Writable.

property old_layout
Type:

ImageLayout

Writable.

property range
Type:

SubresourceRange

Writable.

class scenario_runner_py.BufferBarrierInfo
property buffer
Type:

BufferId

Writable.

property offset
Type:

int

Writable.

property size
Type:

int

Writable.

class scenario_runner_py.TensorBarrierInfo
property tensor
Type:

TensorId

Writable.

class scenario_runner_py.MemoryBarrierInfo

Python runtime options

class scenario_runner_py.ScenarioOptions

Configure scenario creation and output.

property capture_frame
Type:

bool

Writable.

property clear_pipeline_cache
Type:

bool

Writable.

property disabled_extensions
Type:

list[str]

Writable.

property enable_gpu_debug_markers
Type:

bool

Writable.

property enable_pipeline_caching
Type:

bool

Writable.

property enable_robustness_features
Type:

bool

Writable.

property fail_on_pipeline_cache_miss
Type:

bool

Writable.

property graph_profiling_dump_dir
Type:

os.PathLike

Writable.

property neural_debug_database_dump_dir
Type:

os.PathLike

Writable.

property neural_statistics_dump_dir
Type:

os.PathLike

Writable.

property neural_statistics_mode
Type:

NeuralAcceleratorStatisticsMode

Writable.

property perf_counters_path
Type:

os.PathLike

Writable.

property pipeline_cache_path
Type:

os.PathLike

Writable.

property profiling_path
Type:

os.PathLike

Writable.

property session_rams_dump_dir
Type:

os.PathLike

Writable.

Supported resource formats

The Format enum uses Python-style names for Vulkan® VkFormat values; for example, Format.R8Uint represents VK_FORMAT_R8_UINT. The supported tensor formats and file-backed image formats are listed in the image and tensor sections of the JSON specification. The Python binding accepts its exposed Format values when creating resources; the selected Vulkan® device must support each format for its requested resource usage.

Enumerations

The following reference is generated from the exported Python enumerations.

class scenario_runner_py.AddressMode(value: SupportsInt | SupportsIndex)

Members:

ClampBorder

ClampEdge

Repeat

MirroredRepeat

Unknown

ClampBorder = <AddressMode.ClampBorder: 0>
ClampEdge = <AddressMode.ClampEdge: 1>
MirroredRepeat = <AddressMode.MirroredRepeat: 3>
Repeat = <AddressMode.Repeat: 2>
Unknown = <AddressMode.Unknown: 4>
property name
Type:

str

Read-only.

property value
Type:

int

Read-only.

class scenario_runner_py.BorderColor(value: SupportsInt | SupportsIndex)

Members:

FloatTransparentBlack

FloatOpaqueBlack

FloatOpaqueWhite

IntTransparentBlack

IntOpaqueBlack

IntOpaqueWhite

FloatCustomExt

IntCustomExt

Unknown

FloatCustomExt = <BorderColor.FloatCustomExt: 6>
FloatOpaqueBlack = <BorderColor.FloatOpaqueBlack: 1>
FloatOpaqueWhite = <BorderColor.FloatOpaqueWhite: 2>
FloatTransparentBlack = <BorderColor.FloatTransparentBlack: 0>
IntCustomExt = <BorderColor.IntCustomExt: 7>
IntOpaqueBlack = <BorderColor.IntOpaqueBlack: 4>
IntOpaqueWhite = <BorderColor.IntOpaqueWhite: 5>
IntTransparentBlack = <BorderColor.IntTransparentBlack: 3>
Unknown = <BorderColor.Unknown: 8>
property name
Type:

str

Read-only.

property value
Type:

int

Read-only.

class scenario_runner_py.DescriptorType(value: SupportsInt | SupportsIndex)

Members:

StorageBuffer

StorageImage

CombinedImageSampler

TensorArm

CombinedImageSampler = <DescriptorType.CombinedImageSampler: 1>
StorageBuffer = <DescriptorType.StorageBuffer: 7>
StorageImage = <DescriptorType.StorageImage: 3>
TensorArm = <DescriptorType.TensorArm: 1000460000>
property name
Type:

str

Read-only.

property value
Type:

int

Read-only.

class scenario_runner_py.FilterMode(value: SupportsInt | SupportsIndex)

Members:

Linear

Nearest

Unknown

Linear = <FilterMode.Linear: 0>
Nearest = <FilterMode.Nearest: 1>
Unknown = <FilterMode.Unknown: 2>
property name
Type:

str

Read-only.

property value
Type:

int

Read-only.

class scenario_runner_py.ImageLayout(value: SupportsInt | SupportsIndex)

Members:

General

TensorAliasing

Undefined

Unknown

General = <ImageLayout.General: 0>
TensorAliasing = <ImageLayout.TensorAliasing: 1>
Undefined = <ImageLayout.Undefined: 2>
Unknown = <ImageLayout.Unknown: 3>
property name
Type:

str

Read-only.

property value
Type:

int

Read-only.

class scenario_runner_py.MemoryAccess(value: SupportsInt | SupportsIndex)

Members:

ComputeShaderWrite

MemoryWrite

MemoryRead

GraphWrite

GraphRead

ComputeShaderRead

Unknown

ComputeShaderRead = <MemoryAccess.ComputeShaderRead: 5>
ComputeShaderWrite = <MemoryAccess.ComputeShaderWrite: 0>
GraphRead = <MemoryAccess.GraphRead: 4>
GraphWrite = <MemoryAccess.GraphWrite: 3>
MemoryRead = <MemoryAccess.MemoryRead: 2>
MemoryWrite = <MemoryAccess.MemoryWrite: 1>
Unknown = <MemoryAccess.Unknown: 6>
property name
Type:

str

Read-only.

property value
Type:

int

Read-only.

class scenario_runner_py.NeuralAcceleratorStatisticsMode(value: SupportsInt | SupportsIndex)

Members:

Disabled

Statistics0

Statistics1

Disabled = <NeuralAcceleratorStatisticsMode.Disabled: 0>
Statistics0 = <NeuralAcceleratorStatisticsMode.Statistics0: 1>
Statistics1 = <NeuralAcceleratorStatisticsMode.Statistics1: 2>
property name
Type:

str

Read-only.

property value
Type:

int

Read-only.

class scenario_runner_py.OpticalFlowGridSize(value: SupportsInt | SupportsIndex)

Members:

Invalid

OneByOne

TwoByTwo

FourByFour

EightByEight

EightByEight = <OpticalFlowGridSize.EightByEight: 3>
FourByFour = <OpticalFlowGridSize.FourByFour: 2>
Invalid = <OpticalFlowGridSize.Invalid: 4294967295>
OneByOne = <OpticalFlowGridSize.OneByOne: 0>
TwoByTwo = <OpticalFlowGridSize.TwoByTwo: 1>
property name
Type:

str

Read-only.

property value
Type:

int

Read-only.

class scenario_runner_py.OpticalFlowPerformanceLevel(value: SupportsInt | SupportsIndex)

Members:

Invalid

Unknown

Slow

Medium

Fast

Fast = <OpticalFlowPerformanceLevel.Fast: 3>
Invalid = <OpticalFlowPerformanceLevel.Invalid: 4294967295>
Medium = <OpticalFlowPerformanceLevel.Medium: 2>
Slow = <OpticalFlowPerformanceLevel.Slow: 1>
Unknown = <OpticalFlowPerformanceLevel.Unknown: 0>
property name
Type:

str

Read-only.

property value
Type:

int

Read-only.

class scenario_runner_py.PipelineStage(value: SupportsInt | SupportsIndex)

Members:

Graph

Compute

Graphics

All

Unknown

All = <PipelineStage.All: 3>
Compute = <PipelineStage.Compute: 1>
Graph = <PipelineStage.Graph: 0>
Graphics = <PipelineStage.Graphics: 2>
Unknown = <PipelineStage.Unknown: 4>
property name
Type:

str

Read-only.

property value
Type:

int

Read-only.

class scenario_runner_py.ShaderStage(value: SupportsInt | SupportsIndex)

Members:

Unknown

Compute

Vertex

Fragment

Compute = <ShaderStage.Compute: 1>
Fragment = <ShaderStage.Fragment: 3>
Unknown = <ShaderStage.Unknown: 0>
Vertex = <ShaderStage.Vertex: 2>
property name
Type:

str

Read-only.

property value
Type:

int

Read-only.

class scenario_runner_py.ShaderType(value: SupportsInt | SupportsIndex)

Members:

Unknown

SpirV

Glsl

Hlsl

Glsl = <ShaderType.Glsl: 2>
Hlsl = <ShaderType.Hlsl: 3>
SpirV = <ShaderType.SpirV: 1>
Unknown = <ShaderType.Unknown: 0>
property name
Type:

str

Read-only.

property value
Type:

int

Read-only.

class scenario_runner_py.Tiling(value: SupportsInt | SupportsIndex)

Members:

Optimal

Linear

Unknown

Linear = <Tiling.Linear: 1>
Optimal = <Tiling.Optimal: 0>
Unknown = <Tiling.Unknown: 2>
property name
Type:

str

Read-only.

property value
Type:

int

Read-only.