Skip to content

Commit 492f4ad

Browse files
committed
Add kernel launcher allocation alignment
1 parent ab9ea4f commit 492f4ad

File tree

2 files changed

+5
-18
lines changed

2 files changed

+5
-18
lines changed

numba_dpex/core/utils/kernel_launcher.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828

2929
MAX_SIZE_OF_SYCL_RANGE = 3
3030

31+
_ARRAY_ALIGN = 16
32+
3133

3234
# TODO: probably not best place for it. Should be in kernel_dispatcher once we
3335
# get merge experimental. Right now it will cause cyclic import
@@ -364,11 +366,13 @@ def _allocate_array(
364366
365367
Returns: An LLVM IR value pointing to the array.
366368
"""
367-
return cgutils.alloca_once(
369+
array = cgutils.alloca_once(
368370
self.builder,
369371
self.context.get_value_type(numba_type),
370372
size=self.context.get_constant(types.uintp, size),
371373
)
374+
array.align = _ARRAY_ALIGN
375+
return array
372376

373377
def _populate_array_from_python_list(
374378
self,

numba_dpex/tests/experimental/test_index_space_ids.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import numba_dpex.experimental as dpex_exp
1414
from numba_dpex.kernel_api import Item, NdItem, NdRange
1515
from numba_dpex.kernel_api import call_kernel as kapi_call_kernel
16-
from numba_dpex.tests._helper import skip_windows
1716

1817
_SIZE = 16
1918
_GROUP_SIZE = 4
@@ -99,8 +98,6 @@ def test_item_get_range():
9998
assert np.array_equal(a.asnumpy(), want)
10099

101100

102-
# TODO: https://github.com/IntelPython/numba-dpex/issues/1308
103-
@skip_windows
104101
def test_nd_item_get_global_range():
105102
a = dpnp.zeros(_SIZE, dtype=dpnp.float32)
106103
dpex_exp.call_kernel(
@@ -114,8 +111,6 @@ def test_nd_item_get_global_range():
114111
assert np.array_equal(a.asnumpy(), want)
115112

116113

117-
# TODO: https://github.com/IntelPython/numba-dpex/issues/1308
118-
@skip_windows
119114
def test_nd_item_get_local_range():
120115
a = dpnp.zeros(_SIZE, dtype=dpnp.float32)
121116
dpex_exp.call_kernel(
@@ -129,8 +124,6 @@ def test_nd_item_get_local_range():
129124
assert np.array_equal(a.asnumpy(), want)
130125

131126

132-
# TODO: https://github.com/IntelPython/numba-dpex/issues/1308
133-
@skip_windows
134127
def test_nd_item_get_global_id():
135128
a = dpnp.zeros(_SIZE, dtype=dpnp.float32)
136129
dpex_exp.call_kernel(
@@ -140,8 +133,6 @@ def test_nd_item_get_global_id():
140133
assert np.array_equal(a.asnumpy(), np.ones(a.size, dtype=np.float32))
141134

142135

143-
# TODO: https://github.com/IntelPython/numba-dpex/issues/1308
144-
@skip_windows
145136
def test_nd_item_get_local_id():
146137
a = dpnp.zeros(_SIZE, dtype=dpnp.float32)
147138

@@ -174,8 +165,6 @@ def test_no_item():
174165
)
175166

176167

177-
# TODO: https://github.com/IntelPython/numba-dpex/issues/1308
178-
@skip_windows
179168
def test_get_group_id():
180169
global_size = 100
181170
group_size = 20
@@ -196,8 +185,6 @@ def test_get_group_id():
196185
assert np.array_equal(ka.asnumpy(), expected)
197186

198187

199-
# TODO: https://github.com/IntelPython/numba-dpex/issues/1308
200-
@skip_windows
201188
def test_get_group_range():
202189
global_size = 100
203190
group_size = 20
@@ -218,8 +205,6 @@ def test_get_group_range():
218205
assert np.array_equal(ka.asnumpy(), expected)
219206

220207

221-
# TODO: https://github.com/IntelPython/numba-dpex/issues/1308
222-
@skip_windows
223208
def test_get_group_local_range():
224209
global_size = 100
225210
group_size = 20
@@ -258,8 +243,6 @@ def set_3d_ones_item(item: Item, a):
258243
a[index] = 1
259244

260245

261-
# TODO: CI tests failing for some reason... Works fine locally on cpu and gpu
262-
@pytest.mark.skip
263246
def test_index_order():
264247
a = dpnp.zeros(I_SIZE * J_SIZE * K_SIZE, dtype=dpnp.int32)
265248

0 commit comments

Comments
 (0)