Skip to content

Commit 2a9209f

Browse files
committed
More complete testing by using new validate_dsl_jit()
1 parent 83b66ba commit 2a9209f

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

tests/ndarray/test_dsl_kernels.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,10 @@ def wrapped_set_pref_expr(self, expression, inputs, fp_accuracy, aux_reduc=None,
318318
assert "float(_i0)" in captured["expr"]
319319
assert "_n1" in captured["expr"]
320320
assert "_i1" in captured["expr"]
321+
# ...and it JIT-compiles rather than silently running on the interpreter.
322+
assert blosc2.validate_dsl_jit(kernel_index_ramp_float_cast, {"x": np.float32}, np.float32, shape=shape)[
323+
"jit"
324+
]
321325

322326

323327
def test_dsl_kernel_index_symbols_int_cast_matches_expected_ramp():
@@ -447,6 +451,10 @@ def wrapped_set_pref_expr(self, expression, inputs, fp_accuracy, aux_reduc=None,
447451
assert "# loop count comes from scalar niter" in captured["expr"]
448452
assert "range(niter)" not in captured["expr"]
449453
assert "float(niter)" not in captured["expr"]
454+
# ...and the loop+scalar kernel JIT-compiles (the original G3 fallback shape).
455+
assert blosc2.validate_dsl_jit(
456+
kernel_loop_param, {"x": a2.dtype, "y": b2.dtype, "niter": niter}, a2.dtype, shape=(32, 32)
457+
)["jit"]
450458
finally:
451459
lazyexpr_mod.try_miniexpr = old_try_miniexpr
452460

0 commit comments

Comments
 (0)