def DPCPPExtension(name, sources, *args, **kwargs):
    r"""
    Creates a :class:`setuptools.Extension` for DPCPP/C++.
    Convenience method that creates a :class:`setuptools.Extension` with the
    bare minimum (but often sufficient) arguments to build a DPCPP/C++
    extension.
    All arguments are forwarded to the :class:`setuptools.Extension`
    constructor.
    Example:
        >>> from intel_extension_for_pytorch.xpu.utils import DpcppBuildExtension, DPCPPExtension
        >>> setup(
                name='dpcpp_extension',
                ext_modules=[
                    DPCPPExtension(
                            name='dpcpp_extension',
                            sources=['extension.cpp', 'extension_kernel.cpp'],
                            extra_compile_args={'cxx': ['-g', '-std=c++20', '-fPIC']})
                ],
                cmdclass={
                    'build_ext': DpcppBuildExtension
                })
    """

    library_dirs = kwargs.get("library_dirs", [])
    library_dirs += library_paths()
    kwargs["library_dirs"] = library_dirs

    libraries = kwargs.get("libraries", [])
    libraries.append("c10")
    libraries.append("torch")
    libraries.append("torch_cpu")
    libraries.append("torch_python")

    # Append oneDNN link parameters.
    libraries.append("dnnl")
    kwargs["libraries"] = libraries

    include_dirs = kwargs.get("include_dirs", [])
    include_dirs += include_paths()
    kwargs["include_dirs"] = include_dirs

    kwargs["language"] = "c++"

    extra_compile_args = kwargs.get("extra_compile_args", {})
    extra_link_args = kwargs.get("extra_link_args", [])
    # add oneapi link parameters
    extra_link_args = _prepare_ldflags(extra_link_args, False, False)
    extra_compile_args = _prepare_compile_flags(extra_compile_args)

    # todo: add dpcpp parameter support.
    kwargs["extra_link_args"] = extra_link_args
    kwargs["extra_compile_args"] = extra_compile_args

    return setuptools.Extension(name, sources, *args, **kwargs)

    Creates a :class:`setuptools.Extension` for DPCPP/C++.
    Convenience method that creates a :class:`setuptools.Extension` with the
    bare minimum (but often sufficient) arguments to build a DPCPP/C++
    extension.
    All arguments are forwarded to the :class:`setuptools.Extension`
    constructor.
    Example:
        >>> from intel_extension_for_pytorch.xpu.utils import DpcppBuildExtension, DPCPPExtension
        >>> setup(
                name='dpcpp_extension',
                ext_modules=[
                    DPCPPExtension(
                            name='dpcpp_extension',
                            sources=['extension.cpp', 'extension_kernel.cpp'],
                            extra_compile_args={'cxx': ['-g', '-std=c++20', '-fPIC']})
                ],
                cmdclass={
                    'build_ext': DpcppBuildExtension
                })
    
intel_extension_for_pytorch/xpu/cpp_extension.py