Skip to main content

TensorConversion.h File

Tensor conversion vocabulary, policies, and tracing. More...

Included Headers

#include "pipeline/TensorCore.h" #include <cstdint> #include <string> #include <vector>

Namespaces Index

namespacesimaai
namespaceneat

Classes Index

structConversionCost

Cost estimate for a conversion: bytes moved + a coarse compute-class bucket (low/med/high). More...

structConversionTrace

Single audit-log entry for a conversion that occurred. More...

structConversionTraceCollector

Collects ConversionTrace entries for post-mortem auditing of a pipeline run. More...

Description

Tensor conversion vocabulary, policies, and tracing.

When a tensor needs to change form mid-pipeline (different dtype, layout, device, or memory layout), the framework classifies the change as one of five ConversionKinds and applies the configured ConversionPolicy to decide whether to allow it silently, allow it but record a trace entry, or refuse it. Used by validation, by the planner when inserting adapter stages, and by tools that audit pipeline conversions.

File Listing

The file content with the documentation metadata removed is:

1
12#pragma once
13
15
16#include <cstdint>
17#include <string>
18#include <vector>
19
20namespace simaai::neat {
21
31enum class ConversionKind {
32 Reinterpret = 0,
33 View,
34 Pack,
35 Convert,
37};
38
47enum class ConversionPolicy {
48 Strict = 0,
51};
52
55 std::uint64_t bytes_copied = 0;
56 int compute_class = 0;
57};
58
67 std::string stage;
69 std::string
71 std::string dst_desc;
72 std::uint64_t bytes_copied = 0;
73 std::uint64_t elapsed_us = 0;
75};
76
79 std::vector<ConversionTrace> traces;
80
82 void add(ConversionTrace trace) {
83 traces.push_back(std::move(trace));
84 }
86 void clear() {
87 traces.clear();
88 }
89};
90
93ConversionCost estimate_conversion_cost(ConversionKind kind, std::uint64_t bytes_copied);
96
97} // namespace simaai::neat

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.