|
| 1 | +[general] |
| 2 | +# it could also be an expression as long as `Meta.parse` can parse this string successfully. |
| 3 | +# basically, it should be the `expression` in the following code: |
| 4 | +# ccall((function_name, expression), returntype, (argtype1, ...), argvalue1, ...) |
| 5 | +library_name = "libdnnl" |
| 6 | + |
| 7 | +# this entry allows you to specify different library names for different headers. |
| 8 | +# in the following example: |
| 9 | +# library_names = {"config.h" = "libclang_config", "libclang_p.*.h" = "libclang_patch"} |
| 10 | +# those functions in the `config.h` will be generated as: |
| 11 | +# ccall((function_name, libclang_config), returntype, (argtype1, ...), argvalue1, ...) |
| 12 | +library_names = {} |
| 13 | + |
| 14 | +# output file path relative to the working directory |
| 15 | +output_file_path = "../src/onednn/lib.jl" |
| 16 | + |
| 17 | +# if these are set, common file (types and constants) and API file (functions) will be separated |
| 18 | +# this is for compatibility, so prologue and epilogue are not supported. |
| 19 | +# output_api_file_path = "api.jl" |
| 20 | +# output_common_file_path = "common.jl" |
| 21 | + |
| 22 | +# if this entry is not empty, the generator will print the code below to the `output_file_path`. |
| 23 | +# module module_name |
| 24 | +# |
| 25 | +# end # module |
| 26 | +module_name = "Lib" |
| 27 | + |
| 28 | +# if this entry is not empty, the generator will print the code below to the `output_file_path`. |
| 29 | +# using jll_pkg_name |
| 30 | +# export jll_pkg_name |
| 31 | +jll_pkg_name = "oneDNN_jll" |
| 32 | + |
| 33 | +# for packages that have extra JLL package dependencies |
| 34 | +jll_pkg_extra = [] |
| 35 | + |
| 36 | +# identifiers that starts with the string listed in this entry will be exported. |
| 37 | +export_symbol_prefixes = ["CX", "clang_"] |
| 38 | + |
| 39 | +# the code in the following file will be copy-pasted to `output_file_path` before the generated code. |
| 40 | +# this is often used for applying custom patches, e.g. adding missing definitions. |
| 41 | +prologue_file_path = "prologue.jl" |
| 42 | + |
| 43 | +# the code in the following file will be copy-pasted to `output_file_path` after the generated code. |
| 44 | +# this is often used for applying custom patches. |
| 45 | +epilogue_file_path = "" |
| 46 | + |
| 47 | +# node with an id in the `output_ignorelist` will be ignored in the printing passes. |
| 48 | +# this is very useful for custom editing. |
| 49 | +output_ignorelist = [ |
| 50 | + "CINDEX_EXPORTS", |
| 51 | + "CINDEX_VERSION", |
| 52 | + "CINDEX_VERSION_STRING", |
| 53 | + "CINDEX_LINKAGE", |
| 54 | + "CINDEX_DEPRECATED", |
| 55 | + "LLVM_CLANG_C_STRICT_PROTOTYPES_BEGIN", |
| 56 | + "LLVM_CLANG_C_STRICT_PROTOTYPES_END", |
| 57 | + "LLVM_CLANG_C_EXTERN_C_BEGIN", |
| 58 | + "LLVM_CLANG_C_EXTERN_C_END" |
| 59 | +] |
| 60 | + |
| 61 | +# Julia's `@enum` do not allow duplicated values, so by default, C enums are translated to |
| 62 | +# CEnum.jl's `@cenum`. |
| 63 | +# if this entry is true, `@enum` is used and those duplicated enum constants are just commented. |
| 64 | +use_julia_native_enum_type = false |
| 65 | + |
| 66 | +# use `@cenum` but do not print `using CEnum`. |
| 67 | +# this is useful in the case of using `CEnum` directly in the source tree instead of using `CEnum` as a dependency |
| 68 | +print_using_CEnum = false |
| 69 | + |
| 70 | +# Print enums directly as integers without @(c)enum wrapper |
| 71 | +# Override above two options |
| 72 | +print_enum_as_integer = false |
| 73 | + |
| 74 | +# use deterministic symbol instead of `gensym`-generated `var"##XXX"` |
| 75 | +use_deterministic_symbol = true |
| 76 | + |
| 77 | +# by default, only those declarations in the local header file are processed. |
| 78 | +# those declarations in the system headers will be treated specially and will be generated if necessary. |
| 79 | +# if you'd like to generate all of the symbols in the system headers, please set this option to false. |
| 80 | +is_local_header_only = true |
| 81 | + |
| 82 | +# set this option to false if you'd like to ignore the symbols(even if necessary) in the system headers. |
| 83 | +generate_isystem_symbols = true |
| 84 | + |
| 85 | +# if this option is set to true, C code with a style of |
| 86 | +# ```c |
| 87 | +# typedef struct { |
| 88 | +# int x; |
| 89 | +# } my_struct; |
| 90 | +# ``` |
| 91 | +# will be generated as: |
| 92 | +# ```julia |
| 93 | +# struct my_struct |
| 94 | +# x::Cint |
| 95 | +# end |
| 96 | +# ``` |
| 97 | +# instead of |
| 98 | +# ```julia |
| 99 | +# struct var"##Ctag#NUM" |
| 100 | +# x::Cint |
| 101 | +# end |
| 102 | +# const my_struct = var"##Ctag#NUM" |
| 103 | +# ``` |
| 104 | +smart_de_anonymize = true |
| 105 | + |
| 106 | +# if set to true, static functions will be ignored |
| 107 | +skip_static_functions = false |
| 108 | + |
| 109 | +# EXPERIMENTAL |
| 110 | +# if this option is set to true, those structs that are not necessary to be an |
| 111 | +# immutable struct will be generated as a mutable struct. |
| 112 | +# this option is default to false, do read the paragraph below before using this feature. |
| 113 | +auto_mutability = false |
| 114 | + |
| 115 | +# add inner constructor `Foo() = new()` |
| 116 | +auto_mutability_with_new = true |
| 117 | + |
| 118 | +# if you feel like certain structs should not be generated as mutable struct, please add them in the following list. |
| 119 | +# for example, if a C function accepts a `Vector` of some type as its argument like: |
| 120 | +# void foo(mutable_type *list, int n); |
| 121 | +# when calling this function via `ccall`, passing a `Vector{mutable_type}(undef, n)` to the first |
| 122 | +# argument will trigger a crash, the reason is mutable structs are not stored inline within a `Vector`, |
| 123 | +# one should use `Ref{NTuple{n,mutable_type}}()` instead. |
| 124 | +# this is not convenient and that's where the `auto_mutability_ignorelist` comes in. |
| 125 | +auto_mutability_ignorelist = [] |
| 126 | + |
| 127 | +# opposite to `auto_mutability_ignorelist` and has a higher priority |
| 128 | +auto_mutability_includelist = [] |
| 129 | + |
| 130 | +# if set to "raw", extract and dump raw c comment; |
| 131 | +# if set to "doxygen", parse and format doxygen comment. |
| 132 | +# note: by default, Clang only parses doxygen comment, pass `-fparse-all-comments` to Clang in order to parse non-doxygen comments. |
| 133 | +extract_c_comment_style = "doxygen" |
| 134 | + |
| 135 | +# Pass a function to explicitly generate documentation. It will be called like |
| 136 | +# `callback_documentation(node::ExprNode, doc::Vector{String})` if it is |
| 137 | +# set. The `doc` argument will contain the docs parsed from the headers if |
| 138 | +# `extract_c_comment_style` is set, otherwise it will be an empty vector. |
| 139 | +# |
| 140 | +# Do *not* set this in the TOML file, it should be set in the generator script |
| 141 | +# to a function that takes in an ExprNode and returns a String[] (string |
| 142 | +# vector). |
| 143 | +# callback_documentation = "" |
| 144 | + |
| 145 | +# if set to true, single line comment will be printed as """comment""" instead of """\ncomment\n""" |
| 146 | +fold_single_line_comment = false |
| 147 | + |
| 148 | +# if set to "outofline", documentation of struct fields will be collected at the "Fields" section of the struct |
| 149 | +# if set to "inline", documentation of struct fields will go right above struct definition |
| 150 | +struct_field_comment_style = "outofline" |
| 151 | + |
| 152 | +# if set to "outofline", documentation of enumerators will be collected at the "Enumerators" section of the enum |
| 153 | +enumerator_comment_style = "outofline" |
| 154 | + |
| 155 | +# if set to true, C function prototype will be included in documentation |
| 156 | +show_c_function_prototype = false |
| 157 | + |
| 158 | +[codegen] |
| 159 | +# map C's bool to Julia's Bool instead of `Cuchar` a.k.a `UInt8`. |
| 160 | +use_julia_bool = true |
| 161 | + |
| 162 | +# set this to true if the C routine always expects a NUL-terminated string. |
| 163 | +# TODO: support filtering |
| 164 | +always_NUL_terminated_string = true |
| 165 | + |
| 166 | +# generate strictly typed function |
| 167 | +is_function_strictly_typed = false |
| 168 | + |
| 169 | +# if true, opaque pointers in function arguments will be translated to `Ptr{Cvoid}`. |
| 170 | +opaque_func_arg_as_PtrCvoid = false |
| 171 | + |
| 172 | +# if true, opaque types are translated to `mutable struct` instead of `Cvoid`. |
| 173 | +opaque_as_mutable_struct = true |
| 174 | + |
| 175 | +# if true, use Julia 1.5's new `@ccall` macro |
| 176 | +use_ccall_macro = true |
| 177 | + |
| 178 | +# if true, variadic functions are wrapped with `@ccall` macro. Otherwise variadic functions are ignored. |
| 179 | +wrap_variadic_function = false |
| 180 | + |
| 181 | +# generate getproperty/setproperty! methods for the types in the following list |
| 182 | +field_access_method_list = [] |
| 183 | + |
| 184 | +# the generator will prefix the function argument names in the following list with a "_" to |
| 185 | +# prevent the generated symbols from conflicting with the symbols defined and exported in Base. |
| 186 | +function_argument_conflict_symbols = [] |
| 187 | + |
| 188 | +# emit constructors for all custom-layout structs like bitfield in the list, |
| 189 | +# or set to `true` to do so for all such structs |
| 190 | +add_record_constructors = [] |
| 191 | + |
| 192 | +[codegen.macro] |
| 193 | +# it‘s highly recommended to set this entry to "basic". |
| 194 | +# if you'd like to skip all of the macros, please set this entry to "disable". |
| 195 | +# if you'd like to translate function-like macros to Julia, please set this entry to "aggressive". |
| 196 | +macro_mode = "basic" |
| 197 | + |
| 198 | +# function-like macros in the following list will always be translated. |
| 199 | +functionlike_macro_includelist = [ |
| 200 | + "CINDEX_VERSION_ENCODE", |
| 201 | +] |
| 202 | + |
| 203 | +# if true, the generator prints the following message as comments. |
| 204 | +# "# Skipping MacroDefinition: ..." |
| 205 | +add_comment_for_skipped_macro = true |
| 206 | + |
| 207 | +# if true, ignore any macros that is suffixed with "_H" or in the `ignore_header_guards_with_suffixes` list |
| 208 | +ignore_header_guards = true |
| 209 | +ignore_header_guards_with_suffixes = [] |
| 210 | + |
| 211 | +# if true, ignore those pure definition macros in the C code |
| 212 | +ignore_pure_definition = true |
0 commit comments