MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Yantra::VisionGpuExecutor Class Reference

Stateful GPU dispatch engine for VisionSequence execution. More...

#include <VisionGpuDispatch.hpp>

+ Collaboration diagram for MayaFlux::Yantra::VisionGpuExecutor:

Public Member Functions

bool is_suspended () const
 True when a deferred step has work outstanding and the next run will poll rather than start a fresh sequence.
 
VisionGpuExecutor & operator= (const VisionGpuExecutor &)=delete
 
VisionGpuExecutor & operator= (VisionGpuExecutor &&)=delete
 
void reset ()
 Abandon outstanding work and clear the resume point.
 
Kinesis::Vision::VisionResult run (const Kinesis::Vision::VisionSequence &sequence, const std::shared_ptr< Core::VKImage > &image, uint32_t w, uint32_t h)
 Execute a VisionSequence on the GPU using this instance's own lazily-constructed context set.
 
Kinesis::Vision::VisionResult run (VisionGpuContexts &contexts, const Kinesis::Vision::VisionSequence &sequence, const std::shared_ptr< Core::VKImage > &image, uint32_t w, uint32_t h)
 Execute a VisionSequence on the GPU through an explicit context set.
 
std::shared_ptr< Core::VKImage > select_label (const std::shared_ptr< Core::VKImage > &source, uint32_t target_label, uint32_t w, uint32_t h)
 select_label() using this instance's own lazily-constructed context set.
 
std::shared_ptr< Core::VKImage > select_label (VisionGpuContexts &contexts, const std::shared_ptr< Core::VKImage > &source, uint32_t target_label, uint32_t w, uint32_t h)
 Isolate one ConnectedComponents label's silhouette on GPU, through the explicit context set that produced the label buffer.
 
 VisionGpuExecutor ()=default
 
 VisionGpuExecutor (const VisionGpuExecutor &)=delete
 
 VisionGpuExecutor (VisionGpuExecutor &&)=delete
 
 ~VisionGpuExecutor ()=default
 

Static Public Member Functions

static GpuComputeConfig config (Kinesis::Vision::VisionOp op, const Kinesis::Vision::VisionParams &params)
 GpuComputeConfig for a given VisionOp and its parameters.
 
static std::vector< Kinesis::Vision::Contour > read_exported_contours (const Kinesis::Vision::VisionResult &result)
 Host contours decoded from result.buffers.contours, or empty.
 
static std::vector< Kinesis::Vision::Keypoint > read_exported_keypoints (const Kinesis::Vision::VisionResult &result)
 Host keypoints decoded from result.buffers.keypoints, or empty.
 
static std::vector< Kinesis::Vision::TrackResult > read_exported_tracks (const Kinesis::Vision::VisionResult &result)
 Host tracks decoded from result.buffers.tracks, or empty.
 

Private Member Functions

const std::vector< float > & gaussian_kernel_2d (uint32_t radius, float sigma)
 2D Gaussian kernel for convolution, cached by (radius, sigma bit pattern).
 
Kinesis::Vision::GpuVisionPass::Completed op_canny (VisionGpuContexts &contexts, const Kinesis::Vision::VisionParams &params, const Kinesis::Vision::CannyParams &p)
 Detect edges in the current image with the Canny pipeline.
 
Kinesis::Vision::GpuVisionPass::Completed op_confine (VisionGpuContexts &contexts, const Kinesis::Vision::ConfineParams &p)
 Arbitrary rectangular sub-region of the current image, optionally resized back to the frame's own size before this step.
 
void op_connected_components (VisionGpuContexts &contexts, const Kinesis::Vision::ConnectedComponentsParams &p)
 Label components in the current image on the GPU.
 
bool op_dense_flow (VisionGpuContexts &contexts, const Kinesis::Vision::VisionStep &step)
 Dense optical flow from the previous frame to the current one.
 
void op_extract_peaks (VisionGpuContexts &contexts, const Kinesis::Vision::ExtractPeaksParams &p)
 Extract and rank keypoints from the current response image.
 
bool op_find_contours (VisionGpuContexts &contexts, const Kinesis::Vision::FindContoursParams &p)
 Trace contours from the immediately preceding component labels.
 
Kinesis::Vision::GpuVisionPass::Completed op_harris_response (VisionGpuContexts &contexts, const Kinesis::Vision::HarrisParams &p)
 Compute the Harris response of the current image.
 
Kinesis::Vision::GpuVisionPass::Completed op_open_close (VisionGpuContexts &contexts, Kinesis::Vision::VisionOp op, const Kinesis::Vision::MorphParams &p)
 Apply morphological opening or closing to the current image.
 
Kinesis::Vision::GpuVisionPass::Completed op_threshold_otsu (VisionGpuContexts &contexts, const Kinesis::Vision::OtsuParams &p)
 Apply an Otsu threshold to the current image.
 
bool op_track_keypoints (VisionGpuContexts &contexts, const Kinesis::Vision::VisionStep &step)
 Track the previous frame's keypoints into the current frame.
 

Static Private Member Functions

static void after_step (VisionGpuContexts &contexts, size_t index)
 Run any work a finished step owes the flow context.
 
static void build_flow_pyramid (VisionGpuContexts &contexts, uint32_t requested_levels, uint32_t src_channel)
 Build the current frame's pyramid atlas from the working image.
 
static void op_snapshot (VisionGpuContexts &contexts)
 Copy the working image into this snapshot's own image and append it to VisionResult::snapshots.
 

Private Attributes

std::unique_ptr< VisionGpuContexts > m_contexts
 

Detailed Description

Stateful GPU dispatch engine for VisionSequence execution.

Owns a lazily-constructed VisionGpuContexts (m_contexts) plus any op-specific persistent GPU state that doesn't belong on a shared context (e.g. ConnectedComponents' ping-pong output image). Mirrors VisionExecutor's ownership model on the CPU side: construct one instance per independent pipeline, hold it, call run() every frame.

Immovable: TextureExecutionContext owns GPU resource handles with no copy or move constructor, so VisionGpuContexts and therefore VisionGpuExecutor cannot be copied or moved either. Construct once, hold by reference, pointer, or shared_ptr, reuse indefinitely.

Not safe to call run() concurrently from multiple threads on the same instance. Independent pipelines running concurrently should each own a separate VisionGpuExecutor instance.

Definition at line 261 of file VisionGpuDispatch.hpp.


The documentation for this class was generated from the following files: