Code Generation Options#

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

Option

Description

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

--assume-nd-range-dim=<value>

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

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

--comments

Insert comments explaining the generated code. Default: off.

--enable-ctad

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

--enable-profiling

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

--gen-helper-function

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

--helper-function-preference=<value>

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.

--keep-original-code

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

--no-dry-pattern

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

--optimize-migration

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

--sycl-named-lambda

Generates kernels with the kernel name. Default: off.

--use-explicit-namespace=<value>

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.

--usm-level=<value>

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

--enable-codepin

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