docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
targets.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
7
8namespace docc::compile {
9class SrcFileCompilerBuilder;
10}
11
12namespace docc::target {
13
15 std::string target;
16 std::string category;
18 bool already_normalized = false;
21 bool fp_contract = true;
24 std::string contraction_precision = "native";
25 // Non-owning reference to the caller's option bag (typically owned by the
26 // front-end / PyStructuredSDFG). Stored as a pointer so it can be reseated
27 // after default construction (e.g. filled field-by-field from Python).
29};
30
31struct DoccTarget {
32 static constexpr int NEWEST_API_VER = 3;
33
35 std::string short_name;
36
42
45 sdfg::analysis::AnalysisManager& analysis_manager,
46 const TargetOptions& options
47 );
50 sdfg::analysis::AnalysisManager& analysis_manager,
51 const TargetOptions& options
52 );
53 std::function<bool(docc::compile::SrcFileCompilerBuilder& src_compile_builder)>
55 if (api_ver >= 1) {
57 } else {
58 return nullptr;
59 }
60 }
61 std::function<bool(
63 sdfg::analysis::AnalysisManager& analysis_manager,
64 const TargetOptions& options
65 )>
67 if (api_ver >= 1) {
69 } else {
70 return nullptr;
71 }
72 }
73 std::function<bool(
75 sdfg::analysis::AnalysisManager& analysis_manager,
76 const TargetOptions& options
77 )>
79 if (api_ver >= 1) {
81 } else {
82 return nullptr;
83 }
84 }
85
86 std::vector<std::shared_ptr<
87 sdfg::passes::scheduler::LoopScheduler>> (*get_target_loop_schedulers)(const TargetOptions& options);
88 [[nodiscard]] std::vector<std::shared_ptr<sdfg::passes::scheduler::LoopScheduler>>
90 if (api_ver >= 2 && get_target_loop_schedulers != nullptr) {
91 return get_target_loop_schedulers(options);
92 } else {
93 return {};
94 }
95 }
96
99 std::string default_contraction_precision = "native";
100
101 [[nodiscard]] std::string safe_get_default_contraction_precision() const {
102 return api_ver >= 3 ? default_contraction_precision : "native";
103 }
104
108
109 [[nodiscard]] bool safe_get_direct_contraction_rescaling() const {
111 }
112};
113
114} // namespace docc::target
Definition src_file_compiler_builder.h:31
Definition options.h:56
static const Options & empty()
Definition options.h:84
Definition analysis.h:53
Note: Even though the class references unique_ptr, it will never delete an SDFG it has a reference to...
Definition structured_sdfg_builder.h:44
Definition loop_scheduler.h:27
Definition targets.h:8
Definition targets.h:12
Definition function_builder.h:10
Definition targets.h:31
bool direct_contraction_rescaling
Whether quantized and Ozaki contractions multiply by their scales and compute in the contraction's ow...
Definition targets.h:107
bool safe_get_direct_contraction_rescaling() const
Definition targets.h:109
int api_ver
Definition targets.h:34
std::function< bool(sdfg::builder::StructuredSDFGBuilder &builder, sdfg::analysis::AnalysisManager &analysis_manager, const TargetOptions &options)> safe_apply_sched_time_mapping_fn_get()
Definition targets.h:78
std::string short_name
Definition targets.h:35
bool(* apply_additional_compile_options)(docc::compile::SrcFileCompilerBuilder &src_compile_builder)
Definition targets.h:37
bool(* apply_sched_time_mapping)(sdfg::builder::StructuredSDFGBuilder &builder, sdfg::analysis::AnalysisManager &analysis_manager, const TargetOptions &options)
Definition targets.h:48
static constexpr int NEWEST_API_VER
Definition targets.h:32
bool(* apply_expand_time_mapping)(sdfg::builder::StructuredSDFGBuilder &builder, sdfg::analysis::AnalysisManager &analysis_manager, const TargetOptions &options)
Consider these hooks experimental.
Definition targets.h:43
std::vector< std::shared_ptr< sdfg::passes::scheduler::LoopScheduler > >(* get_target_loop_schedulers)(const TargetOptions &options)
Definition targets.h:87
std::vector< std::shared_ptr< sdfg::passes::scheduler::LoopScheduler > > safe_get_target_loop_schedulers(const TargetOptions &options) const
Definition targets.h:89
std::string safe_get_default_contraction_precision() const
Definition targets.h:101
std::function< bool(sdfg::builder::StructuredSDFGBuilder &builder, sdfg::analysis::AnalysisManager &analysis_manager, const TargetOptions &options)> safe_apply_expand_time_mapping_fn_get()
Definition targets.h:66
std::string default_contraction_precision
How Float and Double matmuls compute when the user selects nothing, as TargetOptions::contraction_pre...
Definition targets.h:99
std::function< bool(docc::compile::SrcFileCompilerBuilder &src_compile_builder)> safe_apply_additional_compile_options_fn_get()
Definition targets.h:54
Definition targets.h:14
bool already_normalized
Definition targets.h:18
bool enable_fusion_in_normalize
Definition targets.h:19
bool remote_tuning
Definition targets.h:17
std::string contraction_precision
How Float and Double matmuls compute: native, int2 ... int8 (quantized), ozaki, ozaki1[:s] or ozaki2[...
Definition targets.h:24
std::string category
Definition targets.h:16
bool fp_contract
Definition targets.h:21
std::string target
Definition targets.h:15
bool use_new_fusion_in_simplify
Definition targets.h:20
const sdfg::Options * options
Definition targets.h:28