Skip to content

capability/capability_types.hpp

Namespaces

Name
sgns
sgns::sgprocessing
Artifact and manifest binary serialization.

Classes

Name
struct sgns::sgprocessing::PassTypeHash
struct sgns::sgprocessing::UnmetRequirement
struct sgns::sgprocessing::ExecutorCapability
Declared capability of a registered executor (D-11).
struct sgns::sgprocessing::CapabilitySnapshot
struct sgns::sgprocessing::CanExecuteResult
Result of a CanExecute check (D-05, D-07).

Types

Name
enum class UnmetRequirementCategory

Types Documentation

enum UnmetRequirementCategory

Enumerator Value Description
VULKAN 0 Vulkan device/feature/limit insufficiency.
MNN 1 MNN model format or quantization not supported.
PASS_TYPE 2 No executor registered for the requested PassType.
RESOURCE 3 GPU memory or disk space insufficient.

Category of unmet requirement for structured capability rejection (D-06). Follows same enum-prefix convention as ProcessingErrorStage in processing_processor.hpp.

Source code

#ifndef SGPROCMGR_CAPABILITY_TYPES_HPP
#define SGPROCMGR_CAPABILITY_TYPES_HPP

#include <PassType.hpp>
#include <cstdint>
#include <string>
#include <unordered_map>
#include <vector>
#include <vulkan/vulkan.h>

namespace sgns::sgprocessing
{

    struct PassTypeHash
    {
        size_t operator()( PassType p ) const { return static_cast<size_t>( p ); }
    };

    enum class UnmetRequirementCategory
    {
        VULKAN   = 0,  
        MNN      = 1,  
        PASS_TYPE = 2, 
        RESOURCE = 3   
    };

    struct UnmetRequirement
    {
        UnmetRequirementCategory category = UnmetRequirementCategory::RESOURCE;
        std::string              detail;  
    };

    struct ExecutorCapability
    {
        PassType                   passType;              
        std::vector<std::string>   supportedModelFormats; 
        std::vector<std::string>   supportedQuantizations;
        std::string                backend;               
    };

    struct CapabilitySnapshot
    {
        VkPhysicalDeviceProperties           vulkanProps{};     
        VkPhysicalDeviceMemoryProperties     memProps{};       
        std::vector<ExecutorCapability>      executorCaps;     
        uint64_t                             availableDiskBytes = 0; 
        std::vector<uint8_t>                 identityHash;     
        std::unordered_map<PassType, bool, PassTypeHash> checkpointSupport; 
    };

    struct CanExecuteResult
    {
        bool                          executable  = false; 
        std::string                   executorId;          
        std::vector<UnmetRequirement> unmet;               
    };

} // namespace sgns::sgprocessing

#endif // SGPROCMGR_CAPABILITY_TYPES_HPP

Updated on 2026-09-17 at 06:29:15 +0000