Skip to content

Conversation

@diptorupd
Copy link
Contributor

  • Have you provided a meaningful PR description?

All parfor array arguments are now inferred as USMNdArray instead of DpnpNdArray. The change ensures that any kernel functions (LLVM IR function with a spir_kernel calling convention) that is generated from a parfor always has an address space qualifier for every pointer argument. Defining a kernel function that has pointer arguments with no address space qualifier results in a crash for OpenCL UHD Graphics driver-based devices.

  • Have you added a test, reproducer or referred to an issue with a reproducer?
    No existing tests were tested with ONEAPI_DEVICE_SELECTOR=opencl:gpu
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • If this PR is a work in progress, are you filing the PR as a draft?

Diptorup Deb added 2 commits June 16, 2023 18:45
   - Previously, any dpnp.ndarray objects used as an argument in a
     parfor was a numba_dpex.core.types.DpnpNdArray. The commit changes
     that and casts all dpnp.ndarray arguments of a parfor to
     numba_dpex.core.types.USMNdArray.

     The reason for the change is as follows:

     Although, DpnpNdArray derives from USMNdArray the two types use
     different data models. USMNdArray uses the
     numba_dpex.core.datamodel.models.ArrayModel data model that defines all
     CPointer type members in the GLOBAL address space. The DpnpNdArray uses
     Numba's default ArrayModel that does not define pointers in any specific
     address space. For OpenCL HD Graphics devices, defining a kernel
     function (spir_kernel calling convention) with pointer arguments that
     have no address space qualifier causes a run time crash. By casting
     the argument type for parfor arguments from DpnpNdArray type to the
     USMNdArray type the generated kernel always has an address space
     qualifier, avoiding the issue on OpenCL HD graphics devices.
@diptorupd diptorupd merged commit b1dec85 into fix/jenkins_ci Jun 17, 2023
@diptorupd diptorupd deleted the fix/opencl_gpu_exec branch June 17, 2023 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant