本文整理汇总了C++中Func::function方法的典型用法代码示例。如果您正苦于以下问题:C++ Func::function方法的具体用法?C++ Func::function怎么用?C++ Func::function使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Func
的用法示例。
在下文中一共展示了Func::function方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: count_host_alignment_asserts
int count_host_alignment_asserts(Func f, std::map<string, int> m) {
Target t = get_jit_target_from_environment();
t.set_feature(Target::NoBoundsQuery);
f.compute_root();
Stmt s = Internal::lower({f.function()}, f.name(), t);
CountHostAlignmentAsserts c(m);
s.accept(&c);
return c.count;
}
示例2: count_interleaves
int count_interleaves(Func f) {
Target t = get_jit_target_from_environment();
t.set_feature(Target::NoBoundsQuery);
t.set_feature(Target::NoAsserts);
Stmt s = Internal::lower(f.function(), t);
CountInterleaves i;
s.accept(&i);
return i.result;
}
示例3: uses_branches
bool uses_branches(Func f) {
Target t = get_jit_target_from_environment();
t.set_feature(Target::NoBoundsQuery);
t.set_feature(Target::NoAsserts);
Stmt s = Internal::lower(f.function(), t);
ContainsBranches b;
s.accept(&b);
return b.result;
}
示例4: apply_schedule
void apply_schedule(const schedule_map &schedules, Func root) {
// TODO: this should be encapsulated in a find_all_calls helper
// extract all the functions called transitively from root, by name
Function f = root.function();
map<string, Function> functions = find_transitive_calls(f);
// add the root function into the environment, too
functions[f.name()] = f;
// for each function named in the schedule_map, apply the schedule to the
// Function object by overwriting its schedule field by reference.
for (schedule_map::const_iterator it = schedules.begin();
it != schedules.end(); ++it)
{
fprintf(stderr, "Apply schedule to %s\n", it->first.c_str());
assert(functions.count(it->first));
functions[it->first].schedule() = it->second[0];
for (size_t r = 0; r < functions[it->first].reductions().size(); r++) {
functions[it->first].reduction_schedule(r) = it->second[r+1];
}
}
}
示例5: LoopLevel
LoopLevel::LoopLevel(Func f, VarOrRVar v) : LoopLevel(f.function().name(), v.name(), v.is_rvar) {}