Skip to content

Add Level Zero support for program compilation for dpctl #210

Closed

Description

@diptorupd

dpctl program interface only supports OpenCL. To improve the situation, we need to support compiling kernels from Spir-V IL (Numba will be the primary consumer of this feature) and possibly from source files.

DPC++ does not yet provide a way to create a SYCL program from a SPIR-V IL, the feature is intended as a future enhancement. For this reason, dpctl needs to first generate an interoperability program and then create a SYCL program object from it. We already do this for OpenCL:

createOpenCLInterOpProgram (const context &SyclCtx,

This issue ticket is implement the same feature for Level Zero driver API. Our implementation should be similar to the way the feature is implemented in DPC++:
https://github.com/intel/llvm/blob/68fc7808a50eba4d777e3442fbe5a1cc2e125bcd/sycl/plugins/level_zero/pi_level_zero.cpp#L2672

Other relevant references are:

  1. Level Zero API: https://spec.oneapi.com/level-zero/latest/core/api.html?highlight=zemodulecreate#module
  2. Level Zero Programming Guide: https://spec.oneapi.com/level-zero/latest/core/PROG.html#modules-and-kernels

Activity

  1. self-assigned this
    on Dec 8, 2020
  2. diptorupd commented on Dec 9, 2020

    @diptorupd
    ContributorAuthor

    Building a level zero module has some differences with the compilation process of OpenCL programs. There are some extra options that can be passed in as module descriptions. One of the key module description attributes is Specialization Constants. These are run-time (host program execution) generated values that are constant during the compilation of the module. Typically, specialization constants are used to pass hardware-specific information, e.g., block-size, to the online compiler. Reference for further details https://github.com/intel/llvm/blob/81963d1ec055154bed2428a6232135d06891a53c/sycl/doc/SpecializationConstants.md

  3. diptorupd commented on Jan 21, 2021

    @diptorupd
    ContributorAuthor

    Closed by #241

  4. diptorupd commented on Jan 23, 2021

    @diptorupd
    ContributorAuthor

    Completed after merging #241.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions