Intel oneAPI DPC++/C++ Compiler Runtime

2025.3.3 · active · verified Fri Apr 17

The `dpcpp-cpp-rt` package provides the essential runtime libraries and components for applications compiled with the Intel® oneAPI DPC++/C++ Compiler. It is a critical dependency for Python libraries like `dpctl` and `numba-dppy` that leverage SYCL for heterogeneous computing. This package primarily provides shared objects and header files, not directly imported Python modules. It aligns with the Intel oneAPI release cadence, typically receiving annual major updates and more frequent minor revisions.

Common errors

Warnings

Install

Imports

Quickstart

The `dpcpp-cpp-rt` package provides the underlying runtime for SYCL-enabled applications. It does not have direct Python imports. Instead, Python libraries like `dpctl` (Data Parallel Control Library) leverage its presence. This example shows how `dpctl` would interact with the SYCL runtime that `dpcpp-cpp-rt` enables. Ensure your oneAPI environment is sourced before running Python code that uses SYCL.

import os

# This package is a runtime, not directly imported. 
# Its presence allows other Python packages (like dpctl) to function.
# Example using dpctl, which relies on dpcpp-cpp-rt:

try:
    import dpctl
    print("dpctl successfully imported.")
    
    # Try to find a SYCL device
    try:
        device = dpctl.select_default_device()
        print(f"Selected SYCL device: {device.name}")
    except Exception as e:
        print(f"Could not select SYCL device. Ensure SYCL_DEVICE_FILTER is set if needed. Error: {e}")
        print("Make sure oneAPI environment is sourced and DPC++ runtime is configured correctly.")

except ImportError:
    print("dpctl is not installed. This quickstart demonstrates usage of a library that depends on dpcpp-cpp-rt.")
    print("Install with: pip install dpctl")

# You would typically set environment variables before running Python code
# For example, to filter devices:
# os.environ['SYCL_DEVICE_FILTER'] = 'opencl:gpu,cpu'

view raw JSON →