Skip to content
Closed
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
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ recursive-include numba_dppy *.spir

include versioneer.py
include numba_dppy/_version.py

recursive-include numba_dppy/examples *
2 changes: 2 additions & 0 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ build:
number: {{ GIT_DESCRIBE_NUMBER }}
script_env:
- WHEELS_OUTPUT_FOLDER
- NUMBA_DPPY_TESTING_GDB_ENABLE

requirements:
build:
Expand All @@ -34,6 +35,7 @@ requirements:
test:
requires:
- pytest
- pexpect

about:
home: https://github.com/IntelPython/numba-dppy
Expand Down
19 changes: 18 additions & 1 deletion conda-recipe/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,24 @@

set -euxo pipefail

pytest -q -ra --disable-warnings --pyargs numba_dppy -vv
PYTEST_ARGS="-q -ra --disable-warnings"
PYARGS="numba_dppy -vv"
DEBUGGER_VERSION=10.2.4

if [[ -v NUMBA_DPPY_TESTING_GDB_ENABLE ]]; then
PYARGS="$PYARGS -k test_debug_dppy_numba"

# Activate debugger
if [[ -v ONEAPI_ROOT ]]; then
set +ux
# shellcheck disable=SC1090
source "${ONEAPI_ROOT}/debugger/${DEBUGGER_VERSION}/env/vars.sh"
set -ux
fi
fi

# shellcheck disable=SC2086
pytest $PYTEST_ARGS --pyargs $PYARGS

if [[ -v ONEAPI_ROOT ]]; then
set +u
Expand Down
26 changes: 22 additions & 4 deletions numba_dppy/tests/test_debug_dppy_numba.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,29 @@
from numba_dppy import config

pexpect = pytest.importorskip("pexpect")
if not sys.platform == "linux":
pytest.skip("OS is not linux", allow_module_level=True)

pytestmark = pytest.mark.skipif(
not shutil.which("gdb-oneapi"),
reason="Intel® Distribution for GDB* is not available",
)

def module_loaded(module_name):
import subprocess

lsmod = subprocess.Popen(["lsmod"], stdout=subprocess.PIPE)
grep = subprocess.Popen(["grep", module_name], stdin=lsmod.stdout)
grep.communicate()
return grep.returncode == 0


pytestmark = [
pytest.mark.skipif(
not shutil.which("gdb-oneapi"),
reason="Intel® Distribution for GDB* is not available",
),
pytest.mark.skipif(
not module_loaded("igfxdcd"),
reason="Module igfxdcd is not loaded",
),
]


# TODO: go to helper
Expand Down