ML Workload Library for Vulkan® C++ API

API reference

namespace workloadlib

Typedefs

using ExecutableRecordHook = std::function<void(const ExecutableRecordContext&)>

Callable invoked around one executable dispatch.

Enums

enum class RuntimeDeviceCapability : uint32_t

Capabilities required of a runtime-owned Vulkan device.

Values:

enumerator Compute
enumerator DataGraph
enumerator Tensors
enumerator DataGraphShaderModules
enum class ExecutableRecordPhase

Point relative to an executable dispatch at which a recording hook runs.

Values:

enumerator Before
enumerator After
enum class DataGraphBinaryStorageMode

Storage used after pipeline creation; bytes are caller-supplied in both modes.

Values:

enumerator ImplementationManaged
enumerator ApplicationBacked
enum class Feature

Optional capabilities that may be compiled into the library.

Values:

enumerator GlslModules
enumerator HlslModules
enum class ExecutableKind

Kind of executable represented by workload metadata.

Values:

enumerator Graph
enumerator Compute
enum class ResourceKind

Public workload resource category.

Values:

enumerator Unknown
enumerator Tensor
enumerator StorageBuffer
enumerator Image
enum class ResourceAccess

Access performed by an executable on a resource.

Values:

enumerator Read
enumerator Write
enumerator ReadWrite
enum class ModuleCodeKind

Representation used for executable module code.

Values:

enumerator Missing
enumerator Spirv
enumerator Glsl
enumerator Hlsl

Functions

constexpr RuntimeDeviceCapability operator|(RuntimeDeviceCapability lhs, RuntimeDeviceCapability rhs) noexcept
bool supports(Feature feature)

Returns whether an optional library capability is available.

template<typename T>
class ArrayView
#include <mlworkloadlib/array_view.hpp>

Non-owning view over a contiguous sequence.

Template Parameters:

T -- Element type, which may be const-qualified.

Public Functions

constexpr ArrayView() noexcept = default

Constructs an empty view.

inline constexpr ArrayView(pointer data, std::size_t size) noexcept

Constructs a view from a pointer and element count.

inline constexpr pointer data() const noexcept

Returns the pointer to the first element.

inline constexpr std::size_t size() const noexcept

Returns the number of elements.

inline constexpr bool empty() const noexcept

Returns true when size() is zero.

inline constexpr iterator begin() const noexcept

Returns an iterator to the first element.

inline constexpr iterator end() const noexcept

Returns the past-the-end iterator.

inline constexpr reference operator[](std::size_t index) const noexcept

Returns an element without bounds checking.

class BindingSet
#include <mlworkloadlib/binding_set.hpp>

Move-only resource bindings for a configured Session.

Session::prepare() snapshots the bindings. Bound Vulkan objects are borrowed and must remain valid until submitted work completes.

Public Functions

~BindingSet()

Destroys the binding collection without destroying bound Vulkan objects.

BindingSet(BindingSet&&) noexcept

Transfers the bindings and Session association from another instance.

BindingSet &operator=(BindingSet&&) noexcept

Replaces this instance with the bindings and Session association from another instance.

void bindTensor(ResourceView resource, TensorBindingInfo bindingInfo)

Binds a tensor, replacing any binding for the same resource.

void bindBuffer(ResourceView resource, BufferBindingInfo bindingInfo)

Binds a storage buffer, replacing any binding for the same resource.

void bindImage(ResourceView resource, ImageBindingInfo bindingInfo)

Binds an image, replacing any binding for the same resource.

void bindPushConstants(ExecutableView executable, ArrayView<const std::byte> data)

Copies a payload for one executable, replacing its previous payload.

executable must be a valid view from this binding set’s Workload. The size of data in bytes must equal the largest offset + size of its compiled push-constant ranges, or zero if there are no ranges. Its pointer may be null only when its size is zero. The supplied bytes need not remain valid after this call. Empty data removes any stored payload for the executable and is accepted only when its compiled push-constant requirement is zero. Other executables’ payloads and previously prepared executions are unchanged.

std::vector<std::byte> pushConstants(ExecutableView executable) const

Returns a copy of an executable’s bound payload, or an empty vector.

executable must be a valid view from this binding set’s Workload. Editing the returned bytes does not change the binding.

struct BoundMemoryInfo
#include <mlworkloadlib/binding_types.hpp>

Non-owning memory information for a bound Vulkan resource.

Required when ResourceRequirementsView::requiresBoundMemoryInfo() is true.

class BufferAllocation : public mlsdk::workloadlib::RuntimeAllocation
#include <mlworkloadlib/context.hpp>

Runtime-owned storage buffer and its backing memory.

Public Functions

vk::Buffer handle() const

Returns the owned buffer handle.

struct BufferBindingInfo
#include <mlworkloadlib/binding_types.hpp>

Buffer handle and optional memory information for storage-buffer binding.

struct BufferRequirements
#include <mlworkloadlib/workload_types.hpp>

Storage-buffer-specific resource creation requirements.

class BufferRequirementsView
#include <mlworkloadlib/workload.hpp>

Non-owning view of storage-buffer-specific workload requirements.

Public Functions

vk::BufferUsageFlags usage() const

Returns the Vulkan buffer usage flags required by the workload.

class CompiledExecution
#include <mlworkloadlib/compiled_execution.hpp>

Compiled state shared by Sessions for one Context and Workload.

A Session builds it during configure(); later Sessions reuse it. Context and Workload must outlive this object and Sessions using its state. Sessions keep the compiled state alive if this object is moved or destroyed. The compiling Session supplies compilation inputs before the shared pipelines are created. Later Sessions reuse the pipelines without rebinding those inputs. Creating or configuring Sessions and changing their tiling selections while sharing this state must be serialized. Graph tensor tiling and the tiling of its alias peers are fixed after compilation; other tiling choices remain local to each Session.

Public Functions

CompiledExecution(Context &context, const Workload &workload, SessionOptions options = {})

Creates empty compiled state for a Workload on one Context.

~CompiledExecution()

Releases this object’s reference to compiled state.

CompiledExecution(CompiledExecution&&) noexcept

Moves a compiled-state handle from another object.

CompiledExecution &operator=(CompiledExecution&&) noexcept

Replaces this object’s compiled-state handle.

struct ComputeShaderDescription
#include <mlworkloadlib/workload_types.hpp>

Description used to build a standalone compute workload.

struct ComputeShaderResource
#include <mlworkloadlib/workload_types.hpp>

Public storage resource and descriptor binding for a compute workload.

class Context
#include <mlworkloadlib/context.hpp>

Provides the Vulkan device and queue used by workload sessions.

A Context either owns objects created by create() or borrows objects passed to wrap(). It must outlive dependent Sessions and allocations.

Public Functions

~Context()

Destroys owned Vulkan objects or releases references to wrapped objects.

ContextView contextView() const

Returns a non-owning view of this Context’s Vulkan objects.

TensorAllocation createTensor(ResourceView resource) const

Allocates a host-visible tensor with Linear tiling.

TensorAllocation createTensor(ResourceView resource, vk::TensorTilingARM tiling) const

Allocates a host-visible tensor with the requested tiling.

BufferAllocation createBuffer(ResourceView resource) const

Allocates a host-visible buffer compatible with a workload resource.

ImageAllocation createImage(ResourceView resource) const

Allocates a device-local image with Optimal tiling.

ImageAllocation createImage(ResourceView resource, vk::ImageTiling tiling) const

Allocates a device-local image with the requested tiling.

Public Static Functions

static Context create(const RuntimeContextDeviceRequirements &deviceRequirements = {})

Creates a Context that owns its Vulkan instance, device, and queue.

static Context wrap(ContextView contextView)

Creates a Context that borrows application-owned Vulkan objects.

Enabled extensions and features are not validated.

struct ContextView
#include <mlworkloadlib/context.hpp>

Application-owned Vulkan objects that can be borrowed by a Context.

The objects must belong to the same device and remain valid while used by the Context or its dependent objects.

Public Functions

inline ContextView(const vk::raii::Instance &instance, const vk::raii::PhysicalDevice &physicalDevice, const vk::raii::Device &device, uint32_t queueFamilyIndex, const vk::raii::Queue &queue)

Constructs a view over caller-owned Vulkan objects.

struct DataGraphConstant
#include <mlworkloadlib/workload_types.hpp>

Constant tensor supplied to a standalone data graph workload.

Constant payloads are borrowed rather than copied. The payload must remain valid for the lifetime of the Workload created from the description.

struct Sparsity
#include <mlworkloadlib/workload_types.hpp>
struct DataGraphDescription
#include <mlworkloadlib/workload_types.hpp>

Description used to build a standalone data graph workload.

struct DataGraphPipelineMetadata
#include <mlworkloadlib/workload_types.hpp>

Vulkan data graph pipeline metadata.

class DataGraphPipelineMetadataView
#include <mlworkloadlib/workload.hpp>

Non-owning view of Vulkan data graph pipeline metadata.

This metadata is meaningful for ExecutableKind::Graph executables.

Public Functions

std::string_view identifier() const

Returns the implementation-defined pipeline identifier.

vk::PipelineCreateFlags2 flags() const

Returns the data graph pipeline creation flags.

ArrayView<const vk::SpecializationMapEntry> specializationMapEntries() const

Returns borrowed Vulkan specialization map entries.

ArrayView<const std::byte> specializationData() const

Returns packed specialization bytes borrowed from the original Workload.

struct DataGraphPipelinePropertyData
#include <mlworkloadlib/session.hpp>

Raw data returned for one graph-pipeline property.

struct DataGraphResource
#include <mlworkloadlib/workload_types.hpp>

Public storage resource and descriptor binding for a data graph workload.

struct DataGraphSessionMemoryInfo
#include <mlworkloadlib/session.hpp>

Non-owning information about one graph-session memory allocation.

struct DispatchShape
#include <mlworkloadlib/workload_types.hpp>

Compute dispatch dimensions in workgroups.

struct ExecutableRecordContext
#include <mlworkloadlib/prepared_execution.hpp>

Context passed to a hook around one executable dispatch.

class ExecutableView
#include <mlworkloadlib/workload.hpp>

Non-owning view of one workload executable.

Public Functions

uint32_t index() const

Returns the executable’s zero-based Workload index.

std::string_view name() const

Returns the executable name as a borrowed string view.

ExecutableKind type() const

Returns whether this is a data graph or compute executable.

ModuleView module() const

Returns the executable module.

DataGraphPipelineMetadataView dataGraphPipelineMetadata() const

Returns data graph pipeline metadata for this executable.

uint32_t interfaceDescriptorBindingCount() const

Returns the number of descriptor bindings for public resources.

InterfaceDescriptorBindingInfo interfaceDescriptorBinding(uint32_t bindingIndex) const

Returns one public-resource descriptor binding by index.

class ImageAllocation : public mlsdk::workloadlib::RuntimeAllocation
#include <mlworkloadlib/context.hpp>

Runtime-owned image, image view, and backing memory.

Public Functions

vk::Image handle() const

Returns the owned image handle.

ImageBindingInfo binding() const

Returns binding information that borrows this allocation.

The returned handles remain valid only while this allocation remains alive and has not been moved from.

struct ImageBindingInfo
#include <mlworkloadlib/binding_types.hpp>

Image descriptor and optional memory information for image binding.

The subresource range must match ImageRequirementsView::requiredSubresourceRange(). If layout has a value, PreparedExecution transitions the image from that layout to ImageRequirementsView::requiredLayout() before its first workload use. If it has no value, image layout transitions remain the caller’s responsibility.

struct ImageRequirements
#include <mlworkloadlib/workload_types.hpp>

Image-specific descriptor and resource creation requirements.

class ImageRequirementsView
#include <mlworkloadlib/workload.hpp>

Non-owning view of image-specific workload requirements.

Public Functions

vk::Extent3D extent() const

Returns the required image extent.

vk::ImageUsageFlags usage() const

Returns the required image usage flags for Optimal tiling.

vk::ImageUsageFlags usage(vk::ImageTiling tiling) const

Returns the required image usage flags for the selected tiling.

bool isSampled() const

Returns true for a combined image-sampler descriptor.

bool isStorage() const

Returns true for a storage-image descriptor.

bool hasRuntimeSampler() const

Returns true if the runtime must create the sampler from workload metadata.

bool requiresSamplerBinding() const

Returns true if the caller must provide a sampler in ImageBindingInfo.

vk::ImageLayout requiredLayout() const

Returns the image layout required when the resource is accessed.

vk::ImageSubresourceRange requiredSubresourceRange() const

Returns the image subresource range required by the workload.

struct InterfaceDescriptorBindingInfo
#include <mlworkloadlib/workload.hpp>

Public descriptor binding metadata for one executable resource.

struct ModuleImplementation
#include <mlworkloadlib/workload_types.hpp>

Module code and compilation options used to construct or complete a workload.

Either spirv or source is consumed according to codeKind. Optional representations require the corresponding Feature to be available when the Session is configured.

class ModuleView
#include <mlworkloadlib/workload.hpp>

Non-owning view of a workload module.

Public Functions

uint32_t index() const

Returns the module’s zero-based Workload index.

std::string_view name() const

Returns the module name as a borrowed string view.

std::string_view entryPoint() const

Returns the module entry-point name as a borrowed string view.

ModuleCodeKind codeKind() const

Returns the representation of the module code.

bool requiresImplementation() const

Returns true if this module has no implementation in the Workload.

struct NeuralStatisticsOptions
#include <mlworkloadlib/compiled_execution.hpp>

Neural-statistics state used for graph pipeline and session creation.

struct PipelineRobustnessOptions
#include <mlworkloadlib/compiled_execution.hpp>

Typed robustness state chained into compute pipeline creation.

class PlaceholderModuleView
#include <mlworkloadlib/workload.hpp>

Non-owning view of a module whose code is absent from the Workload.

Use Session::bindModule() to supply code when needed.

Public Functions

uint32_t index() const

Returns the zero-based index within the placeholder-module sequence.

ModuleView module() const

Returns the underlying module view.

class PreparedExecution
#include <mlworkloadlib/prepared_execution.hpp>

Prepared binding snapshot that can run or record a workload.

The Session and bound Vulkan objects must remain valid until submitted work completes. PreparedExecution is move-only.

Public Functions

~PreparedExecution()

Releases descriptor state and runtime-created execution resources.

PreparedExecution(PreparedExecution&&) noexcept

Transfers the prepared state from another instance.

PreparedExecution &operator=(PreparedExecution&&) noexcept

Replaces this object with prepared state transferred from another instance.

void run()

Records, submits, and waits for one workload execution.

void record(vk::CommandBuffer commandBuffer)

Records workload commands into a caller-owned command buffer.

commandBuffer must be recording and compatible with the Context queue family. The caller ends, submits, and synchronizes the command buffer.

void record(vk::CommandBuffer commandBuffer, const RecordOptions &options)

Records a workload and invokes optional hooks immediately before and after each executable dispatch.

Hooks may record commands into the supplied command buffer. Their callable state and any Vulkan objects they use remain caller-owned.

struct RecordOptions
#include <mlworkloadlib/prepared_execution.hpp>

Optional caller-owned commands recorded around each executable dispatch.

struct ResourceRequirements
#include <mlworkloadlib/workload_types.hpp>

Common and kind-specific requirements for a workload resource.

kind may be inferred from a supported descriptorType. Conversely, tensor and storage-buffer descriptor types may be inferred from kind. Image resources must explicitly select a sampled- or storage-image descriptor type. Only the kind-specific member matching kind is consumed.

class ResourceRequirementsView
#include <mlworkloadlib/workload.hpp>

Non-owning view of requirements for a public workload resource.

Use the asTensor(), asBuffer(), or asImage() member matching kind() for kind-specific requirements.

Public Functions

ResourceKind kind() const

Returns the public resource category.

vk::DescriptorType descriptorType() const

Returns the Vulkan descriptor type, or a default value when none is defined.

vk::Format format() const

Returns the resource element or texel format.

bool participatesInAliasing() const

Returns true if the resource belongs to a Vulkan alias group.

bool requiresBoundMemoryInfo() const

Returns true if a binding must include valid BoundMemoryInfo.

vk::DeviceSize elementCount() const

Returns the logical element count, or zero when it cannot be determined.

vk::DeviceSize byteSize() const

Returns the required storage size in bytes, or zero when it cannot be determined.

TensorRequirementsView asTensor() const

Narrows this view to tensor requirements.

BufferRequirementsView asBuffer() const

Narrows this view to storage-buffer requirements.

ImageRequirementsView asImage() const

Narrows this view to image requirements.

class ResourceView
#include <mlworkloadlib/workload.hpp>

Non-owning view of a bindable public workload resource.

Public Functions

uint32_t index() const

Returns the resource’s zero-based public index.

std::string_view name() const

Returns the resource name as a borrowed string view.

ResourceAccess access() const

Returns the combined access performed by workload executables.

ResourceRequirementsView requirements() const

Returns a non-owning view of the resource requirements.

class RuntimeAllocation
#include <mlworkloadlib/context.hpp>

Base class for a Vulkan resource and memory owned by the runtime.

Allocations are move-only. Destroying an allocation releases its resource and backing memory; therefore it must outlive any BindingSet or PreparedExecution that borrows its handles.

Subclassed by mlsdk::workloadlib::BufferAllocation, mlsdk::workloadlib::ImageAllocation, mlsdk::workloadlib::TensorAllocation

Public Functions

BoundMemoryInfo memory() const

Returns the resource’s backing-memory range.

RuntimeAllocation(RuntimeAllocation&&) noexcept

Transfers ownership from another allocation.

RuntimeAllocation &operator=(RuntimeAllocation&&) noexcept

Replaces this allocation with ownership transferred from another allocation.

struct RuntimeContextDeviceRequirements
#include <mlworkloadlib/context.hpp>

Requirements for a runtime-owned Context.

By default, Context::create() requires compute, tensor, and data-graph shader-module support. Extension names and the feature chain are borrowed for the duration of the call. These requirements do not apply to Context::wrap(). Compute or data-graph support must be selected.

struct SamplerRequirements
#include <mlworkloadlib/workload_types.hpp>

Parameters used when the runtime creates a sampler for an image.

class Session
#include <mlworkloadlib/session.hpp>

Configured runtime state for a Workload on a Context.

Context and Workload are borrowed and must outlive the Session.

Public Functions

Session(Context &context, const Workload &workload, SessionOptions options = {})

Creates an unconfigured Session with its own compiled state.

Session(Context &context, const Workload &workload, CompiledExecution &compiledExecution)

Creates an unconfigured Session sharing state with compiledExecution.

~Session()

Releases session-specific objects and its reference to compiled state.

void bindModule(PlaceholderModuleView placeholderModule, ModuleImplementation implementation)

Supplies or replaces code for a placeholder module before configure().

void bindDataGraphBinary(ArrayView<const std::byte> binary, DataGraphBinaryStorageMode storageMode = DataGraphBinaryStorageMode::ImplementationManaged, ArrayView<const uint8_t> pipelineIdentifier = {}, uint32_t executableIndex = 0)

Supplies or replaces borrowed binary bytes for one graph executable before configure().

void setTensorTiling(ResourceView resource, vk::TensorTilingARM tiling)

Chooses this Session’s public tensor tiling before configure().

void setImageTiling(ResourceView resource, vk::ImageTiling tiling)

Chooses this Session’s public image tiling before configure().

vk::TensorTilingARM tensorTiling(ResourceView resource) const

Returns the tiling selected for a public tensor resource.

vk::ImageTiling imageTiling(ResourceView resource) const

Returns the tiling selected for a public image resource.

void configure()

Builds or reuses pipelines and layouts, then creates per-Session data graph and command objects.

std::vector<vk::DataGraphPipelinePropertyARM> dataGraphPipelineProperties(uint32_t executableIndex) const

Returns the properties advertised by one configured graph pipeline.

DataGraphPipelinePropertyData dataGraphPipelineProperty(uint32_t executableIndex, vk::DataGraphPipelinePropertyARM property) const

Retrieves raw data for one advertised graph-pipeline property.

uint32_t dataGraphSessionMemoryCount(uint32_t executableIndex) const

Returns the number of owned memory allocations for one graph session.

DataGraphSessionMemoryInfo dataGraphSessionMemory(uint32_t executableIndex, uint32_t memoryIndex) const

Returns a non-owning view of one graph-session memory allocation.

BindingSet createBindingSet()

Creates an empty BindingSet associated with this Session.

PreparedExecution prepare(const BindingSet &bindings)

Validates and snapshots bindings for execution.

struct SessionOptions
#include <mlworkloadlib/compiled_execution.hpp>

Pipeline compilation and graph-session configuration options.

Public Functions

inline void requireHostVisibleSessionMemory() noexcept

Requires host-visible, host-coherent graph-session memory.

Public Members

const vk::raii::PipelineCache *pipelineCache = nullptr

Borrowed pipeline cache; keep valid through the first successful Session::configure().

std::optional<PipelineRobustnessOptions> pipelineRobustness

Optional compute-pipeline robustness state.

std::optional<NeuralStatisticsOptions> neuralStatistics

Enables graph-pipeline neural statistics using the selected session mode.

std::optional<vk::MemoryPropertyFlags> requiredSessionMemoryProperties

Required properties for all graph-session memory allocations.

When unset, regular allocations require device-local memory and neural statistics allocations require host-visible, host-coherent memory.

struct SpecializationInfo
#include <mlworkloadlib/workload_types.hpp>

Vulkan specialization-constant map entries and their packed data.

Each map entry’s offset and size identify bytes in data. Constant IDs must be unique and every entry must fit within the data buffer.

class TensorAllocation : public mlsdk::workloadlib::RuntimeAllocation
#include <mlworkloadlib/context.hpp>

Runtime-owned tensor and its backing memory.

Public Functions

vk::TensorARM handle() const

Returns the owned tensor handle.

struct TensorBindingInfo
#include <mlworkloadlib/binding_types.hpp>

Tensor handle and optional memory information for tensor binding.

struct TensorRequirements
#include <mlworkloadlib/workload_types.hpp>

Tensor-specific resource creation requirements.

class TensorRequirementsView
#include <mlworkloadlib/workload.hpp>

Non-owning view of tensor-specific workload requirements.

Public Functions

vk::TensorUsageFlagsARM usage() const

Returns the tensor usage flags configured in workload metadata.

vk::TensorUsageFlagsARM usage(vk::TensorTilingARM tiling) const

Returns the required tensor usage flags for the selected tiling, including image aliasing.

ArrayView<const int64_t> shape() const

Returns a borrowed view of the tensor dimensions.

ArrayView<const int64_t> stride() const

Returns a borrowed view of optional Vulkan tensor stride metadata.

class Workload
#include <mlworkloadlib/workload.hpp>

Immutable workload metadata and executable descriptions consumed by Session.

Construct a Workload with a static factory function. Views and ranges borrow its storage and must not outlive it.

Public Functions

~Workload()

Destroys the workload and invalidates all views obtained from it.

uint32_t resourceCount() const

Returns the number of bindable public resources.

ResourceView resource(uint32_t publicResourceIndex) const

Returns one public resource by index.

ResourceRange resources() const

Returns a borrowed range over all public resources.

uint32_t executableCount() const

Returns the number of executables in dispatch order.

ExecutableView executable(uint32_t executableIndex) const

Returns one executable by index.

ExecutableRange executables() const

Returns a borrowed range over executables in dispatch order.

uint32_t placeholderModuleCount() const

Returns the number of modules that require caller-provided code.

PlaceholderModuleView placeholderModule(uint32_t placeholderModuleIndex) const

Returns one placeholder module by index.

PlaceholderModuleRange placeholderModules() const

Returns a borrowed range over all placeholder modules.

Public Static Functions

static Workload fromVGF(const std::filesystem::path &path)

Loads a VGF-backed Workload from a file.

static Workload fromVGF(const void *data, std::size_t size)

Decodes a VGF-backed Workload from caller-owned memory.

The memory range [data, data + size) must remain valid and unchanged for the lifetime of the returned Workload.

static Workload fromComputeShader(ComputeShaderDescription description)

Builds a Workload containing one standalone compute executable.

static Workload fromDataGraph(DataGraphDescription description)

Builds a Workload containing one standalone data graph executable.

DataGraphConstant payloads are borrowed and must remain valid for the lifetime of the returned Workload.

class ExecutableRange
#include <mlworkloadlib/workload.hpp>

Borrowed range over the Workload’s executables.

Public Functions

Iterator begin() const

Returns an iterator to the first executable.

Iterator end() const

Returns the past-the-end iterator.

class Iterator : public mlsdk::workloadlib::Workload::RangeIteratorBase<Iterator>
#include <mlworkloadlib/workload.hpp>

Iterator that yields ExecutableView values.

Public Functions

ExecutableView operator*() const

Returns the executable at the current iterator position.

class PlaceholderModuleRange
#include <mlworkloadlib/workload.hpp>

Borrowed range over modules whose code must be supplied by the caller.

Public Functions

Iterator begin() const

Returns an iterator to the first placeholder module.

Iterator end() const

Returns the past-the-end iterator.

class Iterator : public mlsdk::workloadlib::Workload::RangeIteratorBase<Iterator>
#include <mlworkloadlib/workload.hpp>

Iterator that yields PlaceholderModuleView values.

Public Functions

PlaceholderModuleView operator*() const

Returns the placeholder module at the current iterator position.

class ResourceRange
#include <mlworkloadlib/workload.hpp>

Borrowed range over the Workload’s public resources.

Public Functions

Iterator begin() const

Returns an iterator to the first public resource.

Iterator end() const

Returns the past-the-end iterator.

class Iterator : public mlsdk::workloadlib::Workload::RangeIteratorBase<Iterator>
#include <mlworkloadlib/workload.hpp>

Iterator that yields ResourceView values.

Public Functions

ResourceView operator*() const

Returns the resource at the current iterator position.