1 #ifndef HALIDE_EXTERNAL_CODE_H
2 #define HALIDE_EXTERNAL_CODE_H
22 std::vector<uint8_t> code;
28 : kind(kind), llvm_target(llvm_target), device_code_kind(device_api), code(code), nametag(
name) {
103 return kind == LLVMBitcode &&
111 return kind == DeviceCode && device_code_kind == current_device;
117 return kind == CPlusPlusSource;
127 const std::string &
name()
const {
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt)
Defines the structure that describes a Halide target.
bool is_c_plus_plus_source() const
True if this container holds C++ source code for inclusion in generating C++ output.
bool is_for_cpu_target(const Target &host) const
Return true if this container holds llvm bitcode linkable with code generated for the target argument...
static ExternalCode bitcode_wrapper(const Target &cpu_type, const std::vector< uint8_t > &code, const std::string &name)
Construct an ExternalCode container from llvm bitcode.
static ExternalCode c_plus_plus_code_wrapper(const std::vector< uint8_t > &code, const std::string &name)
Construct an ExternalCode container from C++ source code.
bool is_for_device_api(DeviceAPI current_device) const
True if this container holds code linkable with a code generated for a GPU.
static ExternalCode device_code_wrapper(DeviceAPI device_api, const std::vector< uint8_t > &code, const std::string &name)
Construct an ExternalCode container from GPU "source code." This container can be used to insert its ...
const std::string & name() const
Retrieve the name of this container.
const std::vector< uint8_t > & contents() const
Retrieve the bytes of external code held by this container.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
DeviceAPI
An enum describing a type of device API.
A struct representing a target machine and os to generate code for.
enum Halide::Target::Arch arch
int bits
The bit-width of the target machine.
enum Halide::Target::OS os