You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The C++ library interface to atJIT is quite minimal.
118
129
To get started, construct the driver for the autotuner:
119
130
120
131
```c++
@@ -126,13 +137,8 @@ To get started, construct the driver for the autotuner:
126
137
}
127
138
```
128
139
129
-
A single driver can handle the tuning of multiple functions.
140
+
A single driver can handle the tuning of multiple functions, each with their own unique partial argument applications.
130
141
The driver only exposes one, do-it-all, variadic method `reoptimize`.
131
-
To actually "drive" the autotuning process, you should ideally call
132
-
`reoptimize` before every function call.
133
-
Sometimes the tuner will JIT compile a new version, or it will return
134
-
an already-compiled version that needs further runtime measurements.
135
-
136
142
Given a tuner `AT`, `reoptimize` has the following generic usage:
137
143
138
144
```c++
@@ -151,32 +157,57 @@ Given a tuner `AT`, `reoptimize` has the following generic usage:
151
157
Providing a runtime value will allow the JIT compiler to specialize based on the value, and [std::placeholders](https://en.cppreference.com/w/cpp/utility/functional/placeholders) (e.g., `std::placeholders::_1`) leave parameters as-is. For example:
auto const& negate = AT.reoptimize(fsub, 0.0, _1);
160
173
161
174
printf("dec(5) == %f\n", decrement(5));
162
175
printf("neg(3) == %f\n", negate(3));
176
+
// ...
163
177
```
164
178
165
179
4. The main option for the tuner is what algorithm to use during the search. If no option is specified, the tuner currently will not perform any search.
166
180
To use the random search, we would specify `tuner::AT_Random` like so:
To actually *drive* the online autotuning process for some function F, you must repeatedly `reoptimize` F and call the newly returned version F' at least once. Ideally, you would ask the tuner for a reoptimized version of F before every call. For example:
The C++ library interface to atJIT is quite minimal.
118
129
To get started, construct the driver for the autotuner:
119
130
120
131
```c++
@@ -126,13 +137,8 @@ To get started, construct the driver for the autotuner:
126
137
}
127
138
```
128
139
129
-
A single driver can handle the tuning of multiple functions.
140
+
A single driver can handle the tuning of multiple functions, each with their own unique partial argument applications.
130
141
The driver only exposes one, do-it-all, variadic method `reoptimize`.
131
-
To actually "drive" the autotuning process, you should ideally call
132
-
`reoptimize` before every function call.
133
-
Sometimes the tuner will JIT compile a new version, or it will return
134
-
an already-compiled version that needs further runtime measurements.
135
-
136
142
Given a tuner `AT`, `reoptimize` has the following generic usage:
137
143
138
144
```c++
@@ -157,12 +163,24 @@ Providing a runtime value will allow the JIT compiler to specialize based on the
157
163
4. The main option for the tuner is what algorithm to use during the search. If no option is specified, the tuner currently will not perform any search.
158
164
To use the random search, we would specify `tuner::AT_Random` like so:
159
165
166
+
```c++
167
+
</include simple_at.cpp TUNERKIND/>
168
+
```
169
+
170
+
#### Autotuning a Function
171
+
172
+
To actually *drive* the online autotuning process for some function F, you must repeatedly `reoptimize` F and call the newly returned version F' at least once. Ideally, you would ask the tuner for a reoptimized version of F before every call. For example:
173
+
160
174
```c++
161
175
</include simple_at.cpp TUNING/>
162
176
```
163
177
178
+
Don't worry about calling `reoptimize` too often. Sometimes the tuner will JIT compile a new version, but often it will return
179
+
a ready-to-go version that needs more runtime measurements to determine its quality.
180
+
164
181
See `doc/readme/simple_at.cpp` for the complete example we have walked through in this section.
165
182
183
+
166
184
<!--
167
185
168
186
Consider the code below from a software that applies image filters on a video stream.
@@ -242,5 +260,8 @@ See file `LICENSE` at the top-level directory of this project.
242
260
Acknowledgements
243
261
------
244
262
245
-
Special thanks to Serge Guelton and Juan Manuel Martinez Caamaño for
246
-
originally developing Easy::jit.
263
+
Special thanks to:
264
+
265
+
* Hal Finkel & Michael Kruse (Argonne National Laboratory)
266
+
* John Reppy (University of Chicago)
267
+
* Serge Guelton & Juan Manuel Martinez Caamaño (originally developed [Easy::jit](https://github.com/jmmartinez/easy-just-in-time))
0 commit comments