1//===- mlir-config.h - MLIR configuration ------------------------*- C -*-===*//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9/* This file enumerates variables from the MLIR configuration so that they
10 can be in exported headers and won't override package specific directives.
11 Defining the variables here is preferable over specifying them in CMake files
12 via `target_compile_definitions` because it is easier to ensure that they are
13 defined consistently across all targets: They are guaranteed to be 0/1
14 variables thanks to #cmakedefine01, so we can test with `#if` and find
15 missing definitions or includes with `-Wundef`. With `#ifdef`, these mistakes
16 can go unnoticed.
17
18 This is a C header that can be included in the mlir-c headers. */
19
20#ifndef MLIR_CONFIG_H
21#define MLIR_CONFIG_H
22
23/* If set, enable deprecated serialization passes. */
24#define MLIR_DEPRECATED_GPU_SERIALIZATION_ENABLE 0
25
26/* Enable expensive checks to detect invalid pattern API usage. Failed checks
27 manifest as fatal errors or invalid memory accesses (e.g., accessing
28 deallocated memory) that cause a crash. Running with ASAN is recommended for
29 easier debugging. */
30#define MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS 0
31
32/* If set, greedy pattern application is randomized: ops on the worklist are
33 chosen at random. For testing/debugging purposes only. This feature can be
34 used to ensure that lowering pipelines work correctly regardless of the order
35 in which ops are processed by the GreedyPatternRewriteDriver. This flag is
36 numeric seed that is passed to the random number generator. */
37/* #undef MLIR_GREEDY_REWRITE_RANDOMIZER_SEED */
38
39/* If set, enables PDL usage. */
40#define MLIR_ENABLE_PDL_IN_PATTERNMATCH 1
41
42/* If set, enables CUDA-related features in CUDA-related transforms, pipelines,
43 and targets. */
44#define MLIR_ENABLE_CUDA_CONVERSIONS 1
45
46/* If set, enables features that depend on the NVIDIA's PTX compiler. */
47#define MLIR_ENABLE_NVPTXCOMPILER 0
48
49/* If set, enables ROCm-related features in ROCM-related transforms, pipelines,
50 and targets. */
51#define MLIR_ENABLE_ROCM_CONVERSIONS 1
52
53#endif
54

source code of llvm_build/tools/mlir/include/mlir/Config/mlir-config.h