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
Copy file name to clipboardExpand all lines: Tools/ApplicationDebugger/array-transform/README.md
+32-39
Original file line number
Diff line number
Diff line change
@@ -24,9 +24,9 @@ scheduler-locking and SIMD lane views. The sample is intended
24
24
for exercising the debugger, not for performance benchmarking.
25
25
26
26
The debugger supports debugging kernels that run on the CPU, GPU, or
27
-
accelerator devices. For convenience, the `array-transform`
28
-
code sample provides the ability to select the target device by passing the
29
-
program `cpu`, `gpu`, or `accelerator` as the command-line argument.
27
+
accelerator devices. Use the ONEAPI_DEVICE_SELECTOR environment variable
28
+
to select device. The default device is Level Zero GPU device, if available.
29
+
For more details on possible values of this variable see [Environment Variables](https://intel.github.io/llvm-docs/EnvironmentVariables.html#oneapi-device-selector).
30
30
The selected device is displayed in the output. Concrete instructions
31
31
about how to run the program and example outputs are given further
32
32
below. For complete setup and usage instructions, see [Get Started with Intel® Distribution for GDB* on Linux* OS Host](https://software.intel.com/en-us/get-started-with-debugging-dpcpp)
@@ -143,18 +143,18 @@ Perform the following steps:
143
143
144
144
2. Run the program:
145
145
```
146
-
$ ./array-transform <device>
146
+
$ ./array-transform
147
147
```
148
-
> Note: `<device>` is the type of the device type to offload the kernel.
149
-
> Use `cpu`, `gpu`, or `accelerator` to select the CPU, GPU, or the
150
-
> FPGA emulator device, respectively. E.g.:
148
+
> Note: to specify a device type to offload the kernel, use
149
+
> the `ONEAPI_DEVICE_SELECTOR` environment variable.
150
+
> E.g. to restrict the offload only to CPU devices use:
151
151
```
152
-
$ ./array-transform cpu
152
+
$ ONEAPI_DEVICE_SELECTOR=*:cpu ./array-transform
153
153
```
154
154
155
155
3. Start a debugging session:
156
156
```
157
-
$ gdb-oneapi --args array-transform <device>
157
+
$ gdb-oneapi array-transform
158
158
```
159
159
160
160
4. Clean the program using:
@@ -165,14 +165,12 @@ Perform the following steps:
165
165
By default, CMake configures the build for Just-in-Time (JIT)
166
166
compilation of the kernel. However, it also offers an option for
167
167
*Ahead-of-Time* (AoT) compilation. To compile the kernel
168
-
ahead-of-time for a specific device, set the `DPCPP_COMPILE_TARGET`
168
+
ahead-of-time for a specific device, set the `SYCL_COMPILE_TARGET`
169
169
option to the desired device during configuration. For CPU, use the
170
170
`cpu` value; for FPGA-emu, use the `fpga-emu` value. Other values are
171
171
assumed to be for GPU and are passed directly to the GPU AoT
172
172
compiler.
173
173
174
-
> *Hint:* Run `ocloc compile --help` to see available GPU device options.
175
-
176
174
For example, to do AoT compilation for a specific GPU device ID:
177
175
178
176
```
@@ -191,6 +189,8 @@ $ sycl-ls
191
189
192
190
In the above example, the device ID is `0x56c1`.
193
191
192
+
> *Hint:* Run `ocloc compile --help` to see all available GPU device options.
193
+
194
194
> **Note**: AoT compilation is particularly helpful in larger
195
195
> applications where compiling with debug information takes
196
196
> considerably longer time.
@@ -223,11 +223,11 @@ dependencies and permissions errors.
223
223
224
224
3. Select Menu "Debug > Start Debugging" to run the program.
225
225
226
-
4. The solution file is configured to pass `cpu` as the argument to the
227
-
program. To select a different device, go to the project's "Configuration
228
-
Properties > Debugging" and set the "Command Arguments" field.
229
-
Use `gpu` or `accelerator` to target the GPU or the FPGA emulator device,
230
-
respectively.
226
+
4. The solution file is configured to set `ONEAPI_DEVICE_SELECTOR=*:cpu`
227
+
for Local Windows Debugging. That setting causes the program to offload
228
+
on a CPU device. To select a different device, go to the project's
229
+
"Configuration Properties > Debugging" and edit the "Environment" field.
230
+
Modify the value of `ONEAPI_DEVICE_SELECTOR` as you need.
231
231
232
232
For detailed instructions about starting and using the debugger,
233
233
please see [Get Started with Intel® Distribution for GDB* on Windows* OS Host](https://www.intel.com/content/www/us/en/develop/documentation/get-started-with-debugging-dpcpp-windows/).
@@ -236,55 +236,48 @@ please see [Get Started with Intel® Distribution for GDB* on Windows* OS Host](
"description": "A small Data Parallel C++ (DPC++) example that is used in the \"Get Started Guide\" of the Application Debugger to exercise major debugger functionality",
6
-
"toolchain": ["dpcpp"],
5
+
"description": "A small SYCL (C++) example that is used in the \"Get Started Guide\" of the Application Debugger to exercise major debugger functionality",
6
+
"toolchain": ["icpx"],
7
7
"dependencies": ["debugger"],
8
8
"languages": [{"cpp":{}}],
9
9
"targetDevice": ["CPU", "GPU"],
@@ -16,16 +16,16 @@
16
16
"steps": [
17
17
"mkdir -p build_cpu; cd build_cpu; cmake ..",
18
18
"make",
19
-
"./array-transform cpu",
19
+
"ONEAPI_DEVICE_SELECTOR=*:cpu ./array-transform",
20
20
"make clean"
21
21
]
22
22
},
23
23
{
24
24
"id": "cpu-aot",
25
25
"steps": [
26
-
"mkdir -p build_cpu_aot; cd build_cpu_aot; cmake .. -DDPCPP_COMPILE_TARGET=cpu",
26
+
"mkdir -p build_cpu_aot; cd build_cpu_aot; cmake .. -DSYCL_COMPILE_TARGET=cpu",
0 commit comments