forked from libocca/occa
-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.default.json
178 lines (162 loc) · 4.42 KB
/
config.default.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
// By default, should be placed in ~/.occa/config.json
// Note it uses most of JSON5 format
{
env: {
OCCA_COLOR_ENABLED: true,
OCCA_DIR: "~/occa",
OCCA_CACHE_DIR: "~/.occa",
OCCA_MEM_BYTE_ALIGN: 64,
OCCA_PATH: [
"/path/to/places/with/kernels",
],
OCCA_CONFIG: "<path to this file>", // (defaults to "${OCCA_CACHE_DIR}/config.json")
},
settings: {
// Automaticly added settings, don't override!
// version: "<Major>.<Minor>.<Patch>", (e.g. "1.0.0")
// okl_version: "<Major>.<Minor>.<Patch>", (e.g. "1.0.0")
// General core object settings
device: {
mode: "<mode-of-the-device>",
verbose: false,
},
kernel: {
mode: "<mode-of-the-kernel>",
verbose: false,
// Silently run even with failed compilations
// kernel::isInitialized() will return false on failed compilations
allow_failed_kernels: false,
// Map of key -> value pairs to `#define key value`
defines: {},
// List of files to `#include "file"`
include: [],
// List of source-code snippets to include at the top of the source code
headers: [],
// OKL Options
okl: {
// Enable/disable okl transformations
enabled: true,
// Validate for proper OKL kernels
// This checks if OKL attributes are used properly. For example:
// @outer, @inner, @shared, @exclusive
validate: true,
// Additional places to search for headers
include_paths: [],
// Macro to expand @restrict variables since it is compiler-dependent in C++
restrict: "__restrict__",
},
},
memory: {
mode: "<mode-of-the-memory>"
verbose: false,
},
stream: {},
// Mode-specific settings
modes: {
Serial: {
kernel: {
compiler: "g++",
compiler_flags: "-O3",
compiler_env_script: "",
// Include certain standard headers such as:
// #include <stdint.h>
// #include <cstdlib>
// #include <cstdio>
// #include <cmath>
include_std: true,
},
},
OpenMP: {
kernel: {
compiler: "g++",
compiler_flags: "-O3",
compiler_env_script: "",
},
},
CUDA: {
device: {
// Required props when creating a CUDA device:
device_id: 0,
}
kernel: {
compiler: "nvcc",
compiler_flags: "-O3",
compiler_env_script: "",
},
memory: {
// Uses unified memory
unified: false,
// Uses host-mapped memory
mapped: false,
// If true, use CU_MEM_ATTACH_HOST instead of CU_MEM_ATTACH_GLOBAL
// with unified memory allocations
attached_host: false,
},
},
HIP: {
device: {
// Required props when creating a HIP device:
device_id: 0,
}
kernel: {
compiler: "hipcc",
compiler_flags: "-O3",
compiler_env_script: "",
// Flags passed to hipcc and not the underlying compiler
hipcc_compiler_flags: "",
// Auto-detected
arch: {
major: "<HIP-major-version>",
minor: "<HIP-minor-version>",
},
// Used with flags "-t gfx <target>"
target: "<HIP-target>",
},
memory: {
// Uses host-mapped memory
mapped: false,
},
},
OpenCL: {
device: {
// Required props when creating a OpenCL device:
platform_id: 0,
device_id: 0,
},
kernel: {
compiler_flags: "",
// Additional extensions to use when compiling kernels
extensions: {
"cl_khr_fp64": true,
},
},
memory: {
// Uses host-mapped memory
mapped: false,
},
},
Metal: {
device: {
// Required props when creating a Metal device:
device_id: 0,
},
kernel: {
compiler_flags: "",
},
},
},
// System settings
sys: {
// Cannot delete any directory less than 2 directories from /
// For example:
// Safe: /home/occa/foo
// Unsafe: /home/foo
safe_rmrf: true,
},
// Caching lock settings
locks: {
stale_warning: 10.0,
stale_age: 20.0,
},
},
}