Halide 22.0.0 Halide compiler and libraries

CodeGen_Metal_Dev.h
Go to the documentation of this file.
1#ifndef HALIDE_CODEGEN_METAL_DEV_H
2#define HALIDE_CODEGEN_METAL_DEV_H
3
4/** \file
5 * Defines the code-generator for producing Apple Metal shading language kernel code
6 */
7
8#include <memory>
9#include <string>
10
11 namespace Halide {
12
13 struct Target;
14
15/** Set the Metal compiler and linker commands to use for generating
16 * precompiled Metal shaders (embedded metallibs instead of source code).
17 * If both are set to non-empty strings, the Metal code generator will invoke
18 * these tools to precompile shaders instead of embedding source code.
19 * The compiler should typically be set to something like "xcrun -sdk macosx metal"
20 * and the linker to "xcrun -sdk macosx metallib".
21 * @param compiler_path The path/command for the Metal compiler
22 * @param linker_path The path/command for the Metal linker
23 */
24 void set_metal_compiler_and_linker(const std::string &compiler_path,
25 const std::string &linker_path);
26
27 namespace Internal {
28
29 struct CodeGen_GPU_Dev;
30
31std::unique_ptr<CodeGen_GPU_Dev> new_CodeGen_Metal_Dev(const Target &target);
32
33/** Get the Metal compiler command that was set via set_metal_compiler_and_linker().
34 * Returns empty string if not set. */
35std::string get_metal_compiler();
36
37/** Get the Metal linker command that was set via set_metal_compiler_and_linker().
38 * Returns empty string if not set. */
39std::string get_metal_linker();
40
41} // namespace Internal
42} // namespace Halide
43
44#endif
Halide::Internal::new_CodeGen_Metal_Dev
std::unique_ptr< CodeGen_GPU_Dev > new_CodeGen_Metal_Dev(const Target &target)
Halide::Internal::get_metal_compiler
std::string get_metal_compiler()
Get the Metal compiler command that was set via set_metal_compiler_and_linker().
Halide::Internal::get_metal_linker
std::string get_metal_linker()
Get the Metal linker command that was set via set_metal_compiler_and_linker().
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition: AbstractGenerator.h:19
Halide::LinkageType::Internal
@ Internal
Not visible externally, similar to 'static' linkage in C.
Halide::set_metal_compiler_and_linker
void set_metal_compiler_and_linker(const std::string &compiler_path, const std::string &linker_path)
Set the Metal compiler and linker commands to use for generating precompiled Metal shaders (embedded ...
Halide::Target
A struct representing a target machine and os to generate code for.
Definition: Target.h:19