Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
run: ./scripts/build_conda_package.sh ${{ matrix.python }}

- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
path: /usr/share/miniconda/conda-bld/linux-64/${{ env.PACKAGE_NAME }}-*.tar.bz2
Expand Down Expand Up @@ -64,7 +64,7 @@ jobs:
activate-environment: ""

- name: Cache conda packages
uses: actions/cache@v2
uses: actions/cache@v3
env:
CACHE_NUMBER: 0 # Increase to reset cache
with:
Expand All @@ -79,7 +79,7 @@ jobs:
- name: Build conda package
run: conda build --no-test --python ${{ matrix.python }} ${{ env.CHANNELS }} conda-recipe
- name: Upload artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }} ${{ matrix.artifact_name }}
path: ${{ env.conda-bld }}${{ env.PACKAGE_NAME }}-*.tar.bz2
Expand All @@ -96,7 +96,7 @@ jobs:

steps:
- name: Download artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}

Expand Down Expand Up @@ -195,7 +195,7 @@ jobs:
- name: Collect dependencies
run: conda install ${{ env.PACKAGE_NAME }} python=${{ matrix.python }} -c $env:GITHUB_WORKSPACE/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
- name: Cache conda packages
uses: actions/cache@v2
uses: actions/cache@v3
env:
CACHE_NUMBER: 1 # Increase to reset cache
with:
Expand Down Expand Up @@ -250,6 +250,8 @@ jobs:

- name: Add dpnp skip variable
run: echo "NUMBA_DPEX_TESTING_SKIP_NO_DPNP=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Smoke test
run: python -c "import numba_dpex.core.runtime._dpexrt_python"
- name: Run tests
run: |
python -m pytest -q -ra --disable-warnings --pyargs ${{ env.MODULE_NAME }} -vv
Expand All @@ -263,7 +265,7 @@ jobs:
python: ["3.8", "3.9", "3.10"]
steps:
- name: Download artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}

Expand Down Expand Up @@ -291,7 +293,7 @@ jobs:
python: ["3.8", "3.9", "3.10"]
steps:
- name: Download artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}

Expand Down
6 changes: 5 additions & 1 deletion numba_dpex/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
"""
The numba-dpex extension module adds data-parallel offload support to Numba.
"""
import numba.testing

import numba_dpex.core.dpjit_dispatcher
import numba_dpex.core.offload_dispatcher

# Initialize the _dpexrt_python extension
import numba_dpex.core.runtime
import numba_dpex.core.targets.dpjit_target

# Re-export types itself
import numba_dpex.core.types as types
from numba_dpex.core.kernel_interface.utils import *
Expand Down
1 change: 0 additions & 1 deletion numba_dpex/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@


from .datamodel import *
from .dpnp_ndarray import dpnp_empty
from .types import *
from .typing import *
9 changes: 7 additions & 2 deletions numba_dpex/core/datamodel/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

from numba.core import datamodel, types
from numba.core.datamodel.models import ArrayModel as DpnpNdArrayModel
from numba.core.datamodel.models import PrimitiveModel, StructModel
from numba.core.datamodel.models import OpaqueModel, PrimitiveModel, StructModel
from numba.core.extending import register_model

from numba_dpex.core.types import Array, DpnpNdArray, USMNdArray
from numba_dpex.utils import address_space

from ..types import Array, DpctlSyclQueue, DpnpNdArray, USMNdArray


class GenericPointerModel(PrimitiveModel):
def __init__(self, dmm, fe_type):
Expand Down Expand Up @@ -81,3 +82,7 @@ def _init_data_model_manager():
# Register the DpnpNdArray type with the Numba ArrayModel
register_model(DpnpNdArray)(DpnpNdArrayModel)
dpex_data_model_manager.register(DpnpNdArray, DpnpNdArrayModel)

# Register the DpctlSyclQueue type with Numba's OpaqueModel
register_model(DpctlSyclQueue)(OpaqueModel)
dpex_data_model_manager.register(DpctlSyclQueue, OpaqueModel)
8 changes: 8 additions & 0 deletions numba_dpex/core/dpjit_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@


class DpjitDispatcher(dispatcher.Dispatcher):
"""A dpex.djit-specific dispatcher.

The DpjitDispatcher sets the targetdescr string to "dpex" so that Numba's
Dispatcher can lookup the global target_registry with that string and
correctly use the DpexTarget context.

"""

targetdescr = dpex_target

def __init__(
Expand Down
214 changes: 0 additions & 214 deletions numba_dpex/core/dpnp_ndarray/dpnp_empty.py

This file was deleted.

25 changes: 25 additions & 0 deletions numba_dpex/core/runtime/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import llvmlite.binding as ll

from ._dpexrt_python import c_helpers

# Register the helper function in _dpexrt_python so that we can insert
# calls to them via llvmlite.
for (
py_name,
c_address,
) in c_helpers.items():
ll.add_symbol(py_name, c_address)
Loading