Skip to content

Commit

Permalink
Migrate experimental.testing and delete the experimental module.
Browse files Browse the repository at this point in the history
  • Loading branch information
diptorupd committed Mar 27, 2024
1 parent c7986c3 commit 7729548
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 42 deletions.
7 changes: 0 additions & 7 deletions numba_dpex/experimental/__init__.py

This file was deleted.

32 changes: 0 additions & 32 deletions numba_dpex/experimental/testing.py

This file was deleted.

29 changes: 26 additions & 3 deletions numba_dpex/tests/kernel_tests/test_async_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,36 @@
import dpctl
import dpnp
import pytest
from numba.core import types
from numba.core.errors import TypingError
from numba.extending import intrinsic

import numba_dpex as dpex
from numba_dpex.experimental import testing
from numba_dpex import dpjit
from numba_dpex.core.runtime.context import DpexRTContext
from numba_dpex.core.targets.dpjit_target import DPEX_TARGET_NAME
from numba_dpex.kernel_api import Item, Range


@intrinsic(target=DPEX_TARGET_NAME)
def _kernel_cache_size(
typingctx, # pylint: disable=W0613
):
sig = types.int64()

def codegen(ctx, builder, sig, llargs): # pylint: disable=W0613
dpexrt = DpexRTContext(ctx)
return dpexrt.kernel_cache_size(builder)

return sig, codegen


@dpjit
def kernel_cache_size() -> int:
"""Returns kernel cache size."""
return _kernel_cache_size() # pylint: disable=E1120


@dpex.kernel(
release_gil=False,
no_compile=True,
Expand Down Expand Up @@ -106,8 +129,8 @@ def test_async_dependent_add():

def test_async_add_from_cache():
test_async_add() # compile
old_size = testing.kernel_cache_size()
old_size = kernel_cache_size()
test_async_add() # use from cache
new_size = testing.kernel_cache_size()
new_size = kernel_cache_size()

assert new_size == old_size

0 comments on commit 7729548

Please sign in to comment.