9#ifndef MLIR_DIALECT_GPU_PIPELINES_PASSES_H_
10#define MLIR_DIALECT_GPU_PIPELINES_PASSES_H_
21 *
this,
"index-bitwidth",
22 llvm::cl::desc(
"Bitwidth of the index type for the host (warning this "
23 "should be 64 until the GPU layering is fixed)"),
26 *
this,
"cubin-triple",
27 llvm::cl::desc(
"Triple to use to serialize to cubin."),
28 llvm::cl::init(
"nvptx64-nvidia-cuda")};
30 *
this,
"cubin-chip", llvm::cl::desc(
"Chip to use to serialize to cubin."),
31 llvm::cl::init(
"sm_75")};
33 *
this,
"cubin-features",
34 llvm::cl::desc(
"Features to use to serialize to cubin."),
37 *
this,
"cubin-format",
38 llvm::cl::desc(
"Compilation format to use to serialize to cubin."),
39 llvm::cl::init(
"fatbin")};
41 *
this,
"ptxas-cmd-options",
43 "Command line options to pass to the downstream compiler."),
47 llvm::cl::desc(
"Optimization level for NVVM compilation"),
50 *
this,
"kernel-bare-ptr-calling-convention",
52 "Whether to use the bareptr calling convention on the kernel "
53 "(warning this should be false until the GPU layering is fixed)"),
54 llvm::cl::init(
false)};
56 *
this,
"host-bare-ptr-calling-convention",
58 "Whether to use the bareptr calling convention on the host (warning "
59 "this should be false until the GPU layering is fixed)"),
60 llvm::cl::init(
false)};
62 *
this,
"allow-pattern-rollback",
63 llvm::cl::desc(
"Allow pattern rollback during dialect conversion"),
64 llvm::cl::init(
true)};
66 *
this,
"default-ctor-priority",
67 llvm::cl::desc(
"Priority of the global constructor and destructor that "
68 "load and unload the GPU binary, for GPU modules that do "
77 *
this,
"index-bitwidth",
78 llvm::cl::desc(
"Bitwidth of the index type for the host (warning this "
79 "should be 64 until the GPU layering is fixed)"),
81 PassOptions::Option<std::string>
arch{
84 "AMDGPU target architecture, as in Clang, with optional target-ID "
85 "modifiers (e.g. gfx942, gfx90a:xnack+, amdgpu9.42-amd-amdhsa, "
86 "amdgpu9.0a-amd-amdhsa--gfx90a:xnack-). Supersedes the separate "
87 "triple option this pipeline used to take. Required: AMDGCN "
88 "binaries are not forward-compatible across chip families.")};
89 PassOptions::Option<std::string>
chip{
90 *
this,
"chip", llvm::cl::desc(
"Deprecated alias for 'arch'."),
93 *
this,
"binary-format",
94 llvm::cl::desc(
"Final GPU binary emission format (e.g. fatbin, binary, "
95 "isa, llvm, offloading)."),
96 llvm::cl::init(
"fatbin")};
99 llvm::cl::desc(
"AMDHSA ABI version (e.g. \"500\", \"600\")."),
100 llvm::cl::init(
"600")};
103 llvm::cl::desc(
"Wavefront size (32 or 64) for targets that run at "
104 "either, or 0 to use the architecture's default."),
108 llvm::cl::desc(
"Optimization level for ROCDL/AMDGPU compilation."),
111 *
this,
"rocdl-cmd-options",
113 "Command line options to pass to the downstream AMDGPU compiler."),
116 *
this,
"kernel-bare-ptr-calling-convention",
117 llvm::cl::desc(
"Use bareptr calling convention for device kernels."),
118 llvm::cl::init(
false)};
120 *
this,
"host-bare-ptr-calling-convention",
121 llvm::cl::desc(
"Use bareptr calling convention for the host."),
122 llvm::cl::init(
false)};
129 *
this,
"xegpu-op-level",
130 llvm::cl::desc(
"Granularity of XeGPU operations to target: workgroup | "
132 llvm::cl::init(
"workgroup")};
134 *
this,
"enable-vector-to-xegpu",
135 llvm::cl::desc(
"Run convert-vector-to-xegpu so the pipeline can accept "
136 "vector dialect (one level above XeGPU) as entry IR"),
137 llvm::cl::init(
false)};
140 *
this,
"use-64bit-index",
141 llvm::cl::desc(
"Bitwidth of the index type (host & device)"),
142 llvm::cl::init(
true)};
144 *
this,
"kernel-bare-ptr-calling-convention",
145 llvm::cl::desc(
"Use bare pointer calling convention for device kernels"),
146 llvm::cl::init(
false)};
148 *
this,
"host-bare-ptr-calling-convention",
149 llvm::cl::desc(
"Use bare pointer calling convention for host launches"),
150 llvm::cl::init(
false)};
152 *
this,
"binary-format",
153 llvm::cl::desc(
"Final GPU binary emission format (e.g. fatbin). Valid "
154 "values are the set of values for the format argument of "
155 "-gpu-module-to-binary pass plus a special value: skip, "
156 "which skips invoking -gpu-module-to-binary pass."),
157 llvm::cl::init(
"fatbin")};
160 *
this,
"xevm-module-matcher",
161 llvm::cl::desc(
"Regex to match gpu.module names for XeVM target attach"),
164 *
this,
"zebin-triple", llvm::cl::desc(
"Target triple for XeVM codegen"),
165 llvm::cl::init(
"spirv64-unknown-unknown")};
167 *
this,
"zebin-chip", llvm::cl::desc(
"Target chip (e.g. pvc, bmg)"),
168 llvm::cl::init(
"bmg")};
171 llvm::cl::desc(
"Optimization level for attached target/codegen"),
174 *
this,
"igc-cmd-options",
175 llvm::cl::desc(
"Additional downstream compiler command line options"),
182 *
this,
"unsupported-source-types",
183 llvm::cl::desc(
"Floating-point source types without arithmetic/math "
184 "support on the target (e.g. bf16)"),
187 *
this,
"supported-target-types",
189 "Floating-point target type used to emulate the unsupported "
190 "source types via extf/truncf pairs"),
191 llvm::cl::init(
"f32")};
197 *
this,
"math-extend-extra-types",
199 "Extra floating-point types with math op support on the target, "
200 "in addition to f32 and f64 (maps to math-extend-to-supported-"
201 "types `extra-types`)"),
213 const GPUToNVVMPipelineOptions &
options);
219 const GPUToROCDLPipelineOptions &
options);
225 const GPUToXeVMPipelineOptions &
options);
static llvm::ManagedStatic< PassManagerOptions > options
This class represents a pass manager that runs passes on either a specific operation type,...
void registerGPUToNVVMPipeline()
Register all pipelines for the gpu dialect.
void registerGPUToXeVMPipeline()
void buildLowerToXeVMPassPipeline(OpPassManager &pm, const GPUToXeVMPipelineOptions &options)
Adds the GPU to XeVM pipeline to the given pass manager.
void registerGPUToROCDLPipeline()
void buildLowerToROCDLPassPipeline(OpPassManager &pm, const GPUToROCDLPipelineOptions &options)
Adds the GPU to ROCDL pipeline to the given pass manager.
void buildLowerToNVVMPassPipeline(OpPassManager &pm, const GPUToNVVMPipelineOptions &options)
Adds the GPU to NVVM pipeline to the given pass manager.
Include the generated interface declarations.
Options for the gpu to nvvm pipeline.
PassOptions::Option< std::string > cubinChip
PassOptions::Option< int > optLevel
PassOptions::Option< bool > allowPatternRollback
PassOptions::Option< bool > hostUseBarePtrCallConv
PassOptions::Option< std::string > cmdOptions
PassOptions::Option< std::string > cubinFeatures
PassOptions::Option< std::string > cubinFormat
PassOptions::Option< int64_t > indexBitWidth
PassOptions::Option< std::string > cubinTriple
PassOptions::Option< bool > kernelUseBarePtrCallConv
PassOptions::Option< unsigned > defaultCtorPriority
Options for the gpu to rocdl pipeline.
PassOptions::Option< std::string > chip
PassOptions::Option< unsigned > waveSize
PassOptions::Option< std::string > cmdOptions
PassOptions::Option< int64_t > indexBitWidth
PassOptions::Option< std::string > abiVersion
PassOptions::Option< bool > hostUseBarePtrCallConv
PassOptions::Option< bool > kernelUseBarePtrCallConv
PassOptions::Option< std::string > arch
PassOptions::Option< std::string > binaryFormat
PassOptions::Option< int > optLevel
PassOptions::Option< bool > hostBarePtrCallConv
PassOptions::ListOption< std::string > unsupportedSourceTypes
PassOptions::Option< unsigned > optLevel
PassOptions::ListOption< std::string > mathExtendExtraTypes
PassOptions::Option< std::string > xegpuOpLevel
PassOptions::Option< std::string > xevmModuleMatcher
PassOptions::Option< std::string > zebinTriple
PassOptions::Option< bool > kernelBarePtrCallConv
PassOptions::Option< std::string > binaryFormat
PassOptions::Option< std::string > supportedTargetTypes
PassOptions::Option< bool > enableVectorToXeGPU
PassOptions::Option< std::string > cmdOptions
PassOptions::Option< bool > use64bitIndex
PassOptions::Option< std::string > zebinChip