ONNX networks

class OnnxNetwork : public virtual klartraum::ComputeGraphElement, public virtual klartraum::ComputeGraphGroup

Public Functions

OnnxNetwork(VulkanContext &vulkanContext, const std::string &modelPath)

ONNX Neural Network Graph Representation.

This class provides GPU-accelerated execution of ONNX models using Klartraum ComputeGraph Framework. It supports:

  1. Loading and parsing ONNX model files

  2. Converting ONNX operations to ComputeGraphElement instances

  3. Managing GPU memory for tensors and intermediate results by ComputeGraphElement instances

virtual void _setup(VulkanContext &vulkanContext, uint32_t numberPaths, VkQueue setupQueue = VK_NULL_HANDLE) override

Initializes resources for the graph paths.

Parameters:
  • vulkanContext – The context providing the resources and queues.

  • numberPaths – The number of execution paths.

  • setupQueue – The queue for uploads and immediate submissions. VK_NULL_HANDLE uses the graphics queue. Pass this queue to nested elements.