Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace parent package for cached_property import #1003

Merged
merged 1 commit into from
Apr 15, 2023
Merged
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
10 changes: 6 additions & 4 deletions numba_dpex/core/descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# SPDX-License-Identifier: Apache-2.0

from functools import cached_property

from numba.core import typing, utils
from numba.core.cpu import CPUTargetOptions
from numba.core.descriptors import TargetDescriptor
Expand All @@ -21,12 +23,12 @@ class DpexKernelTarget(TargetDescriptor):

options = CPUTargetOptions

@utils.cached_property
@cached_property
def _toplevel_target_context(self):
"""Lazily-initialized top-level target context, for all threads."""
return DpexKernelTargetContext(self.typing_context, self._target_name)

@utils.cached_property
@cached_property
def _toplevel_typing_context(self):
"""Lazily-initialized top-level typing context, for all threads."""
return DpexKernelTypingContext()
Expand All @@ -53,12 +55,12 @@ class DpexTarget(TargetDescriptor):

options = CPUTargetOptions

@utils.cached_property
@cached_property
def _toplevel_target_context(self):
# Lazily-initialized top-level target context, for all threads
return DpexTargetContext(self.typing_context, self._target_name)

@utils.cached_property
@cached_property
def _toplevel_typing_context(self):
# Lazily-initialized top-level typing context, for all threads
return typing.Context()
Expand Down
4 changes: 3 additions & 1 deletion numba_dpex/core/targets/dpjit_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"""Defines the target and typing contexts for numba_dpex's dpjit decorator.
"""

from functools import cached_property

from numba.core import utils
from numba.core.codegen import JITCPUCodegen
from numba.core.compiler_lock import global_compiler_lock
Expand Down Expand Up @@ -40,7 +42,7 @@ def init(self):
# rtsys.initialize(self)
self.refresh()

@utils.cached_property
@cached_property
def dpexrt(self):
from numba_dpex.core.runtime.context import DpexRTContext

Expand Down
2 changes: 1 addition & 1 deletion numba_dpex/core/targets/kernel_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# SPDX-License-Identifier: Apache-2.0

import re
from functools import cached_property

import numpy as np
from llvmlite import binding as ll
Expand All @@ -13,7 +14,6 @@
from numba.core.callconv import MinimalCallConv
from numba.core.registry import cpu_target
from numba.core.target_extension import GPU, target_registry
from numba.core.utils import cached_property

from numba_dpex.core.datamodel.models import _init_data_model_manager
from numba_dpex.core.exceptions import UnsupportedKernelArgumentError
Expand Down