Skip to content

Commit b391737

Browse files
committed
intel crash reproducer
1 parent 43a4586 commit b391737

2 files changed

Lines changed: 77 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,34 @@ jobs:
9090
export NO_COLOR=1
9191
test_py_project
9292
93+
crash_reproducer_intel_cl:
94+
name: Crash Reproducer Conda Py3 Intel
95+
runs-on: ubuntu-latest
96+
steps:
97+
- uses: actions/checkout@v6
98+
- name: "Main Script"
99+
run: |
100+
curl -L -O https://raw.githubusercontent.com/illinois-scicomp/machine-shop-maintenance/main/install-intel-icd.sh
101+
sed -i \
102+
-e '0,/^VERSION=/s|^VERSION=.*|VERSION=oclcpuexp-2025.21.10.0.10_160000_rel|' \
103+
-e '0,/^RELEASE=/s|^RELEASE=.*|RELEASE="2025-WW45"|' \
104+
-e '0,/^TBB_VERSION=/s|^TBB_VERSION=.*|TBB_VERSION=2022.2.0|' \
105+
install-intel-icd.sh
106+
sudo bash ./install-intel-icd.sh
107+
108+
CONDA_ENVIRONMENT=.test-conda-env-py3.yml
109+
echo "- ocl-icd-system" >> "$CONDA_ENVIRONMENT"
110+
sed -i "/pocl/ d" "$CONDA_ENVIRONMENT"
111+
export PYOPENCL_TEST=intel
112+
source /opt/enable-intel-cl.sh
113+
114+
EXTRA_INSTALL="scipy"
115+
curl -L -O https://tiker.net/ci-support-v0
116+
. ./ci-support-v0
117+
build_py_project_in_conda_env
118+
export NO_COLOR=1
119+
python intel_crash_reproducer.py
120+
93121
examples3:
94122
name: Examples Conda Py3
95123
runs-on: ubuntu-latest

intel_crash_reproducer.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/usr/bin/env python
2+
"""Generate device code for the ``frozen_result`` kernel.
3+
4+
The kernel below is reconstructed inline from its loopy listing: a (10, 4)
5+
float64 array fill (``_ary = 0.0 + 1.0``) whose two axes have been split into
6+
group/local/chunk inames and tagged for an OpenCL-style execution.
7+
"""
8+
9+
import numpy as np
10+
11+
import loopy as lp
12+
import pyopencl as cl
13+
14+
15+
knl = lp.make_kernel(
16+
"{ [_ary_dim0_chunk, _ary_dim0_group, _ary_dim0_local_one,"
17+
" _ary_dim1_chunk, _ary_dim1_local_zero] :"
18+
" _ary_dim0_chunk = 0 and _ary_dim1_chunk = 0 and _ary_dim0_group >= 0"
19+
" and 0 <= _ary_dim0_local_one <= 9 - 4*_ary_dim0_group"
20+
" and _ary_dim0_local_one <= 3"
21+
" and 0 <= _ary_dim1_local_zero <= 3 }",
22+
"""
23+
_ary[_ary_dim0_local_one + _ary_dim0_group*4 + _ary_dim0_chunk*64,
24+
_ary_dim1_local_zero + _ary_dim1_chunk*16] = 0.0 + 1.0 {id=_ary_store}
25+
""",
26+
[
27+
lp.GlobalArg("_ary", dtype=np.float64, shape=(10, 4), dim_tags="N1,N0"),
28+
],
29+
name="frozen_result",
30+
target=lp.PyOpenCLTarget(),
31+
lang_version=(2018, 2),
32+
)
33+
34+
knl = lp.tag_inames(knl, {
35+
"_ary_dim0_group": "g.0",
36+
"_ary_dim0_local_one": "l.1",
37+
"_ary_dim1_local_zero": "l.0",
38+
})
39+
40+
print(knl)
41+
print()
42+
print(lp.generate_code_v2(knl).device_code())
43+
44+
# Execute the kernel.
45+
ctx = cl.create_some_context(interactive=False)
46+
queue = cl.CommandQueue(ctx)
47+
48+
_evt, (out,) = knl(queue)
49+
print(out.get())

0 commit comments

Comments
 (0)