本文整理汇总了C++中Pipeline::compile_to方法的典型用法代码示例。如果您正苦于以下问题:C++ Pipeline::compile_to方法的具体用法?C++ Pipeline::compile_to怎么用?C++ Pipeline::compile_to使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pipeline
的用法示例。
在下文中一共展示了Pipeline::compile_to方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: emit_filter
void GeneratorBase::emit_filter(const std::string &output_dir,
const std::string &function_name,
const std::string &file_base_name,
const EmitOptions &options) {
build_params();
Pipeline pipeline = build_pipeline();
std::vector<Halide::Argument> inputs = get_filter_arguments();
std::string base_path = output_dir + "/" + (file_base_name.empty() ? function_name : file_base_name);
if (options.emit_o || options.emit_assembly || options.emit_bitcode) {
Outputs output_files;
if (options.emit_o) {
// If the target arch is pnacl, then the output "object" file is
// actually a pnacl bitcode file.
if (Target(target).arch == Target::PNaCl) {
output_files.object_name = base_path + ".bc";
} else if (Target(target).os == Target::Windows &&
!Target(target).has_feature(Target::MinGW)) {
// If it's windows, then we're emitting a COFF file
output_files.object_name = base_path + ".obj";
} else {
// Otherwise it is an ELF or Mach-o
output_files.object_name = base_path + ".o";
}
}
if (options.emit_assembly) {
output_files.assembly_name = base_path + ".s";
}
if (options.emit_bitcode) {
// In this case, bitcode refers to the LLVM IR generated by Halide
// and passed to LLVM, for both the pnacl and ordinary archs
output_files.bitcode_name = base_path + ".bc";
}
pipeline.compile_to(output_files, inputs, function_name, target);
}
if (options.emit_h) {
pipeline.compile_to_header(base_path + ".h", inputs, function_name, target);
}
if (options.emit_cpp) {
pipeline.compile_to_c(base_path + ".cpp", inputs, function_name, target);
}
if (options.emit_stmt) {
pipeline.compile_to_lowered_stmt(base_path + ".stmt", inputs, Halide::Text, target);
}
if (options.emit_stmt_html) {
pipeline.compile_to_lowered_stmt(base_path + ".html", inputs, Halide::HTML, target);
}
}