Halide 22.0.0
Halide compiler and libraries
Loading...
Searching...
No Matches
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
11namespace Halide {
12
13struct 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 */
25 const std::string &linker_path);
26
27namespace Internal {
28
29struct 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
std::unique_ptr< CodeGen_GPU_Dev > new_CodeGen_Metal_Dev(const Target &target)
std::string get_metal_compiler()
Get the Metal compiler command that was set via set_metal_compiler_and_linker().
std::string get_metal_linker()
Get the Metal linker command that was set via set_metal_compiler_and_linker().
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
Internal::ConstantInterval cast(Type t, const Internal::ConstantInterval &a)
Cast operators for ConstantIntervals.
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 ...
A struct representing a target machine and os to generate code for.
Definition Target.h:19