Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
Signed-off-by: Jiang, Zhiwei <[email protected]>
  • Loading branch information
zhiweij1 committed May 14, 2024
1 parent 3fd55a6 commit e2447f2
Showing 1 changed file with 49 additions and 12 deletions.
61 changes: 49 additions & 12 deletions docs/get_started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,31 +87,68 @@ You can optionally provide file paths for source files that should be migrated.
The paths can be found in the compilation database. The following examples show
ways to specify a file or directory for migration.

* Migrate a single source file:
* Prepare for Migration

Generate a compilation database of the project files used to guide migration
.. code-block::
dpct source.cpp
* Migrate all files available in the compilation database:
$ dpct --intercept-build make
$ dpct --intercept-build --parse-build-log <logfile>

Estimate the migration efforts to complete a migration
.. code-block::
dpct -p=<path to the location of compilation database file>
$ dpct --analysis-mode source.cu --analysis-mode-output-file

* Migrate one file in the compilation database:
* Migrate your code

.. code-block::
Migrate a single source file
.. code-block::
dpct -p=<path to the location of compilation database file> source.cpp
$ 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 source files in the directory specified by the ``--in-root`` option and
place generated files in the directory specified by the ``--out-root`` option:
Migrate an entire project
.. code-block::
.. code-block::
$ 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
.. code-block::
$ 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

Query functionally compatible SYCL API for a CUDA API
.. code-block::
$ dpct --query-api-mapping=cudaMalloc

Generate instrumented CUDA and SYCL code for debugging
.. code-block::
$ dpct --enable-codepin source.cu

Generate helper function files in the out-root directory
.. code-block::
$ dpct --gen-helper-function

dpct --in-root=foo --out-root=bar
Display the folder of helper function files
.. code-block::
$ dpct --helper-function-dir

Understand Emitted Warnings
---------------------------
Expand Down

0 comments on commit e2447f2

Please sign in to comment.