Skip to main content

Detess.h File

Detess Node — CVU kernel that untessellates an MLA-layout tensor to natural HWC/CHW. More...

Included Headers

#include "builder/Node.h" #include "builder/NodeContractConfigurable.h" #include "builder/NodeContractProvider.h" #include "builder/OutputSpec.h" #include <nlohmann/json.hpp> #include <memory> #include <optional> #include <string> #include <vector>

Namespaces Index

namespacesimaai
namespaceneat
namespacenodes

Classes Index

structDetessOptions

Construction options for a Detess Node. More...

classDetess

CVU kernel Node that detessellates MLA-layout tensors back to natural HWC/CHW order. More...

Description

Detess Node — CVU kernel that untessellates an MLA-layout tensor to natural HWC/CHW.

Pure layout shuffle — undoes the tile-and-stripe arrangement that the MLA emits, returning tensors in the natural memory order downstream consumers expect. Inserted by the route planner immediately after MLA stages whenever the next consumer is a host-style layout reader.

See Also

"The dtype contract" page in /concepts/dtype_contract

File Listing

The file content with the documentation metadata removed is:

1
12#pragma once
13
14#include "builder/Node.h"
15#include "builder/NodeContractConfigurable.h"
16#include "builder/NodeContractProvider.h"
17#include "builder/OutputSpec.h"
18
19#include <nlohmann/json.hpp>
20
21#include <memory>
22#include <optional>
23#include <string>
24#include <vector>
25
26namespace simaai::neat {
27class Model;
28struct CompiledProcessCvuContract;
29} // namespace simaai::neat
30
31namespace simaai::neat {
32
40 DetessOptions() = default;
42 explicit DetessOptions(const simaai::neat::Model& model);
43
44 std::string config_path;
45 std::string config_dir;
46 bool keep_config = false;
47 bool no_json_path = false;
48 std::optional<nlohmann::json>
50 std::string upstream_name;
51 std::string element_name;
52 std::shared_ptr<const CompiledProcessCvuContract>
54 int num_buffers = 0;
56 bool num_buffers_locked = false;
57};
58
70class Detess final : public Node,
71 public OutputSpecProvider,
72 public NodeContractProvider,
73 public NodeContractConfigurable {
74public:
76 explicit Detess(DetessOptions opt = {});
77 struct ConfigHolder;
78
80 std::string kind() const override {
81 return "Detess";
82 }
84 NodeCapsBehavior caps_behavior() const override {
85 return NodeCapsBehavior::Static;
86 }
88 std::string backend_fragment(int node_index) const override;
90 std::vector<std::string> element_names(int node_index) const override;
92 OutputSpec output_spec(const OutputSpec& input) const override;
96 bool compile_node_contract(const ContractCompileInput& input, CompiledNodeContract* out,
97 std::string* err) const override;
99 void apply_compiled_contract(const CompiledNodeContract& contract, std::string* err) override;
100
102 const nlohmann::json* config_json() const;
103
105 const DetessOptions& options() const {
106 return opt_;
107 }
109 const std::string& config_path() const {
110 return config_path_;
111 }
112
113#ifdef SIMA_NEAT_INTERNAL
114 const std::optional<CompiledProcessCvuContract>& compiled_contract_internal() const;
115#endif
116
117private:
118 DetessOptions opt_;
119 std::shared_ptr<ConfigHolder> config_holder_;
120 std::string config_path_;
121};
122
123} // namespace simaai::neat
124
125namespace simaai::neat::nodes {
127std::shared_ptr<simaai::neat::Node> Detess(DetessOptions opt = {});
128} // namespace simaai::neat::nodes

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.