当前位置: 首页>>代码示例>>C++>>正文


C++ Pipeline::compile_to方法代码示例

本文整理汇总了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);
    }
}
开发者ID:DoDNet,项目名称:Halide,代码行数:49,代码来源:Generator.cpp


注:本文中的Pipeline::compile_to方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。