Code Generation Options#

The following table lists command line options to customize how your code is migrated.




Use async exception handler when creating new sycl::queue with dpct::create_queue in addition to default dpct::get_default_queue. Default: off.


Provides 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).


Limit extension change to .cu and .cuh files only. Default: off.


Enable detection and warnings about Unicode constructs that can be exploited by using bi-directional formatting codes and homoglyphs in identifiers. Default: off.


Insert comments explaining the generated code. Default: off.


Use a C++17 class template argument deduction (CTAD) in your generated code.


Enable SYCL* queue profiling in helper functions. Default: off.


Generates helper function files in the --out-root directory. Default: off.


The preference of helper function usage in migration. Value:

  • =no-queue-device: Call SYCL API to get queue and device instead of calling helper function.


Keeps the original code in the comments of generated SYCL files. Default: off.


Do not use a Don’t Repeat Yourself (DRY) pattern when functions from the dpct namespace are inserted. Default: off.


Generates SYCL code applying more aggressive assumptions that potentially may alter the semantics of your program. Default: off.


Generates kernels with the kernel name. Default: off.


Defines the namespaces to use explicitly in generated code. The value is a comma-separated list. Default: dpct, 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.


Sets the Unified Shared Memory (USM) level to use in source code generation:

  • =none: Uses helper functions from SYCLomatic header files for memory management migration.

  • =restricted: Uses USM API for memory management migration. (default).


EXPERIMENTAL: Generate instrumented CUDA and SYCL code for debug and verification purposes.