-
Notifications
You must be signed in to change notification settings - Fork 96
Expand file tree
/
Copy pathhelp_all.txt
More file actions
251 lines (233 loc) · 22.8 KB
/
help_all.txt
File metadata and controls
251 lines (233 loc) · 22.8 KB
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
USAGE: dpct.exe [options] [<source0> ... <sourceN>]
OPTIONS:
All DPCT options
--always-use-async-handler - Use async exception handler when creating new sycl::queue with dpct::create_queue
in addition to default dpct::get_default_queue. Default: off.
--analysis-mode - Only generate a report for porting effort. Default: off.
--analysis-mode-output-file=<file> - Specify the file where the analysis mode report is saved. Default: Output to stdout.
--analysis-scope-path=<dir> - The directory path for the analysis scope of the source tree that needs to be migrated.
Default: the value of --in-root.
--assume-nd-range-dim=<value> - Provide a hint to the tool on the dimensionality of nd_range to use in generated code.
The values are:
=1 - Generate kernel code assuming 1D nd_range where possible, and 3D in other cases.
=3 - Generate kernel code assuming 3D nd_range (default).
--build-script-file=<file> - Specify the name of generated makefile for migrated file(s).
Default name: Makefile.dpct.
--change-cuda-files-extension-only - Limit extension change to .cu and .cuh files only. Default: off.
--check-unicode-security - Enable detection and warnings about Unicode constructs that can be exploited by using
bi-directional formatting codes and homoglyphs in identifiers. Default: off.
--codepin-report - Call codepin-report.py to generate CodePin report by parsing execution log files generated by instrumented CUDA and SYCL code.
--comments - Insert comments explaining the generated code. Default: off.
--compilation-database=<dir> - The directory path for the compilation database (compile_commands.json) for the files to
be migrated. Paths and build options described in the project file are used to guide the
migration.
When no path is specified, a search for compile_commands.json is attempted through all
parent directories of the first input source file.
Same as -p.
--cuda-include-path=<dir> - The directory path of the CUDA header files.
--enable-codepin - EXPERIMENTAL: Generate instrumented CUDA and SYCL code for debug and verification purposes in the directory <dir>_codepin_cuda and <dir>_codepin_sycl, where <dir> is specified by --out-root option.
--enable-ctad - Use a C++17 class template argument deduction (CTAD) in your generated code.
Default: off.
--enable-profiling - Enable SYCL queue profiling in helper functions. default: auto (when set to
auto, the enable-profiling option will only be used if the tool deduces that profiling is required during migration).
--extra-arg=<string> - Additional argument to append to the migration command line, example:
--extra-arg="-I /path/to/header". The options that can be passed this way can
be found with the dpct -- -help command.
--format-range=<value> - Set the range of formatting.
The values are:
=all - Format all code.
=migrated - Only format the migrated code (default).
=none - Do not format any code.
--format-style=<value> - Set the formatting style.
The values are:
=custom - Use the coding style defined in the .clang-format file (default).
=llvm - Use the LLVM coding style.
=google - Use the Google coding style.
--gen-build-script - Generate makefile for migrated file(s) in -out-root directory. Default: off.
--gen-helper-function - Generate helper function files in the --out-root directory. Default: off.
--help - Display available options.
--help=<value> - Display available options.
=basic - List options for basic migration.
=advanced - List options for advanced migration.
=code-gen - List options to customize how code is migrated.
=report-gen - List option(s) to control report generation during migration.
=build-script - List options to migrate build script(s).
=query-api - List options to query API mapping support.
=warnings - List options to manage warnings generated by the tool.
=help-info - List options to display tool information.
=intercept-build - List options of intercept-build tool.
=examples - List examples of common DPCT options usage.
--helper-function-dir - Print the installation directory for helper function header files.
--helper-function-preference=<value> - The preference of helper function usage in migration.
=no-queue-device - Call SYCL API to get queue and device instead of calling helper function.
--in-root=<dir> - The directory path for the root of the source tree that needs to be migrated.
Only files under this root are migrated. Default: Current directory, if input
source files are not provided. If input source files are provided, the directory
of the first input source file is used.
--in-root-exclude=<dir|file> - Exclude the specified directory or file from processing.
--keep-original-code - Keep the original code in comments of generated SYCL files. Default: off.
--migrate-build-script=<value> - EXPERIMENTAL: A comma-separated list of build script type(s) to be migrated.
By default, no build script is migrated.
The values are:
=CMake - Migrate the CMake file(s).
=Python - Migrate the python build script file(s) of PyTorch based project.
--migrate-build-script-only - EXPERIMENTAL: Only migrate the build script(s). Default: off.
--no-dpcpp-extensions=<value> - A comma-separated list of extensions not to be used in migrated code.
By default, these extensions are used in migrated code.
The values are:
=bfloat16 - Disable the SYCL extensions for bfloat16.
=device_info - Disable the Intel extensions for device information, if supported by the compiler and the backend.
=enqueued_barriers - Disable the enqueued barriers extension.
=free-function-queries - Disable the free function query experimental extension that allows getting 'id', 'item', 'nd_item', 'group', and 'sub_group' instances globally.
=peer_access - Disable the peer access extension.
=assert - Disable the assert extension.
=queue_empty - Disable the queue empty extension.
=all - Disable all extensions listed in this option.
--no-dry-pattern - Do not use DRY (do not repeat yourself) pattern when functions from dpct
namespace are inserted. Default: off.
--no-incremental-migration - Tell the tool to not perform an incremental migration.
Default: off (incremental migration happens).
--optimize-migration - Generate SYCL code applying more aggressive assumptions that potentially
may alter the semantics of your program. Default: off.
--out-root=<dir> - The directory path for root of generated files. A directory is created if it
does not exist. Default: dpct_output.
--output-file=<file> - Redirect the stdout/stderr output to <file> in the output directory specified
by the --out-root option.
--output-verbosity=<value> - Set the output verbosity level:
=detailed - 'normal' and messages about which file is being processed.
=diagnostics - 'detailed' and information about the detected conflicts and crashes. (default)
=normal - 'silent' and warnings, errors, and notes from dpct.
=silent - Only messages from clang.
-p - Alias for --compilation-database.
--process-all - Migrate or copies all files, except hidden, from the --in-root directory
to the --out-root directory. The --in-root option should be explicitly specified.
Default: off.
--query-api-mapping=<api> - Query functionally compatible SYCL API to migrate CUDA API.
--report-file-prefix=<prefix> - Specify the prefix for the migration report file names. The full file name will have a suffix derived
from the report-type, and an extension derived from the report-format. For
example: <prefix>.apis.csv or <prefix>.stats.log. If this option is not
specified, the report will go to stdout. The report files are created in the
directory, specified by -out-root.
--report-format=<value> - Specify the format of the migration reports:
=csv - Output will be lines of comma-separated values. The report file name extension will
be .csv. (default)
=formatted - Output will be formatted for easier readability. Report file name
extension will be log.
--report-only - Generate migration reports only. No SYCL code will be generated. Default: off.
--report-type=<value> - Specify the type of migration report. Values are:
=all - All of the migration reports.
=apis - Information about API signatures that need migration and the number of times
they were encountered. The report file name will have .apis suffix added.
=stats - High level migration statistics: Lines Of Code (LOC) that are migrated to
SYCL, LOC migrated to SYCL with helper functions, LOC not needing migration,
LOC needing migration but are not migrated. The report file name has the .stats
suffix added (default)
--rule-file=<file> - Specify the rule file for migration. Also, reference the predefined rules in the "extensions" directory in the root folder of the tool.
--stop-on-parse-err - Stop migration and generation of reports if parsing errors happened. Default: off.
--suppress-warnings=<value> - A comma separated list of migration warnings to suppress. Valid warning IDs range
from 1000 to 1137. Hyphen separated ranges are also allowed. For example:
--suppress-warnings=1000-1010,1011.
--suppress-warnings-all - Suppress all migration warnings. Default: off.
--sycl-file-extension=<value> - Specify the extension of migrated source file(s).
The values are:
=dp-cpp - Use extension '.dp.cpp' and '.dp.hpp' (default).
=sycl-cpp - Use extension '.sycl.cpp' and '.sycl.hpp'.
=cpp - Use extension '.cpp' and '.hpp'.
--sycl-named-lambda - Generate kernels with the kernel name. Default: off.
--use-dpcpp-extensions=<value> - A comma-separated list of extensions to be used in migrated code.
By default, these extensions are not used in migrated code.
=c_cxx_standard_library - Use std functions from the libdevice library (provided by Intel(R) oneAPI DPC++/C++ Compiler)
and C/C++ Standard Library to migrate functions which have no mapping in the SYCL standard.
If this value is used together with intel_device_math, the intel_device_math functions take
precedence.
=intel_device_math - Use sycl::ext::intel::math functions from the libdevice library (provided by Intel(R) oneAPI
DPC++/C++ Compiler) to migrate functions which have no mapping in the SYCL standard.
=all - Enable all DPC++ extensions listed in this option.
--use-experimental-features=<value> - A comma-separated list of experimental features to be used in migrated code.
By default, experimental features will not be used in migrated code.
The values are:
=free-function-queries - DEPRECATED : Experimental extension that allows getting 'id', 'item', 'nd_item', 'group', and
'sub_group' instances globally. Deprecate this option as the feature is turned on by default.
=local-memory-kernel-scope-allocation - Experimental extension that allows allocation of local memory objects at the kernel
functor scope
=logical-group - Experimental helper function used to logically group work-items.
=root-group - Experimental extension that allows use of root group class and relative API.
=nd_range_barrier - DEPRECATED : Experimental helper function used to help cross-group synchronization during migration. Please use the following option instead: --use-experimental-features=root-group.
=user-defined-reductions - Experimental extension that allows user-defined reductions.
=masked-sub-group-operation - Experimental helper function used to execute sub-group operation with mask.
=dpl-experimental-api - Experimental extension that allows use of experimental oneDPL APIs.
=occupancy-calculation - Experimental helper function used to calculate occupancy.
=matrix - Experimental extension that allows use of matrix extension like class joint_matrix.
=bfloat16_math_functions - Experimental extension that allows use of bfloat16 math functions.
=bindless_images - Experimental extension that allows use of bindless images APIs.
=graph - Experimental extension that allows use of SYCL Graph APIs.
=non-uniform-groups - Experimental extension that allows use of non-uniform groups.
=device_global - Experimental extension that allows device scoped memory allocations into SYCL that can
be accessed within a kernel using syntax similar to C++ global variables.
=virtual_mem - Experimental extension that allows for mapping of an address range onto multiple allocations of physical memory.
=in_order_queue_events - Experimental extension that allows placing the event from the last command submission into the queue and setting an external event as an implicit dependence on the next command submitted to the queue.
=non-stdandard-sycl-builtins - Experimental extension that allows use of non standard SYCL builtin functions.
=prefetch - Experimental extension that allows use of SYCL prefetch APIs.
=level_zero - Experimental migration feature that enables the use of Level Zero APIs to migrate target code, like CUDA Inter-Process Communication (IPC) APIs.
=async_alloc - Experimental extension that allows use of SYCL async allocation APIs.
=all - Enable all experimental extensions listed in this option.
--use-explicit-namespace=<value> - Define the namespaces to use explicitly in generated code. The <value> is a comma
separated list. Default: dpct/syclcompat, sycl.
Possible values are:
=dpct - Generate code with dpct:: namespace.
=none - Generate code without any namespaces. Cannot be used with other values.
=sycl - Generate code with sycl:: namespace. Cannot be used with cl or sycl-math values.
=sycl-math - Generate code with sycl:: namespace, applied only for SYCL math functions.
Cannot be used with cl or sycl values.
=syclcompat - Generate code with syclcompat:: namespace.
--use-syclcompat - Use SYCLcompat header-only library (syclcompat:: namespace) to assist the migration of input source code.
Default: off.
--usm-level=<value> - Set the Unified Shared Memory (USM) level to use in source code generation.
=none - Uses helper functions from DPCT header files for memory management migration.
=restricted - Uses USM API for memory management migration. (default)
--vcxprojfile=<file> - The directory path for the C++ project file (.vcxproj) of the Visual Studio project to
migrate. Paths and build options described in the project file are used to guide the
migration.
--version - Show the version of the tool.
<source0> ... Paths of input source files. These paths are looked up in the compilation database.
EXAMPLES:
Prepare for Migration
=====================
Generate a compilation database of the project files used to guide migration
$ dpct --intercept-build --parse-build-log <logfile>
Migrate src code with SYCLcompat header-only library (syclcompat:: namespace)
$ dpct --use-syclcompat source.cu
Migrate your code
=================
Migrate a single source file
$ dpct source.cu
$ dpct --keep-original-code source.cu # Keep original code
$ dpct --cuda-include-path=/path/to/cuda/include source.cu # Specify the path to CUDA headers
$ dpct --extra-arg="-std=c++11" source.cu # With extra options
$ dpct --extra-arg="-I /path/to/extra/include" source.cu # With additional app args
$ dpct -p=/path/to/compilation-database source.cu # With compilation database
$ dpct --gen-build-script source.cu # Migrate src code and generate Makefile script
Migrate an entire project
$ dpct -p=/path/to/compilation-database --in-root=/path/to/project --out-root=/path/to/migrated-project # With compilation database
$ dpct --process-all --in-root=/path/to/project --out-root=/path/to/migrated-project # Without compilation database
$ dpct -vcxprojfile=/path/to/vcproject/file --in-root=/path/to/project --out-root=/path/to/migrated-project # With VS project file
$ dpct -in-root=/path/to/project --in-root-exclude=/path/to/project/dir1 # Exclude migration of a dir or file
Migrate/generate build scripts for migrated SYCL code
$ dpct --migrate-build-script=CMake -p=/path/to/compilation-database --in-root=/path/to/project --out-root=/path/to/migrated-project # Migrate src code and CMake scripts
$ dpct --migrate-build-script-only -p=/path/to/compilation-database --in-root=/path/to/project --out-root=/path/to/migrated-project # Migrate build script only
$ dpct --gen-build-script -p=/path/to/compilation-database --in-root=/path/to/project --out-root=/path/to/migrated-project # Migrate src code and generate Makefile script
Utils to assist migration
=========================
Estimate the migration efforts to complete a migration
$ dpct --analysis-mode source.cu --analysis-mode-output-file=<file>
Query functionally compatible SYCL API for a CUDA API
$ dpct --query-api-mapping=cudaMalloc
Generate instrumented CUDA and SYCL code and CodePin summary report for debugging
$ dpct --enable-codepin source.cu
$ dpct --codepin-report --instrumented-cuda-log cuda.json --instrumented-sycl-log sycl.json # cuda.json and sycl.json are generated by running instrumented CUDA and SYCL code
Generate helper function files in the out-root directory
$ dpct --gen-helper-function
Display the folder of helper function files
$ dpct --helper-function-dir
See Diagnostics Reference to resolve warnings and complete the migration:
https://oneapi-src.github.io/SYCLomatic/dev_guide/reference/diagnostics-reference.html