Skip to content
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
8 changes: 4 additions & 4 deletions numba_cuda/numba/cuda/cgutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def copy_struct(dst, src, repl=None):
return dst


class _StructProxy(object):
class _StructProxy:
"""
Creates a `Structure` like interface that is constructed with information
from DataModel instance. FE type must have a data model that is a
Expand Down Expand Up @@ -171,7 +171,7 @@ def __setattr__(self, field, value):
Store the LLVM *value* into the named *field*.
"""
if field.startswith("_"):
return super(_StructProxy, self).__setattr__(field, value)
return super().__setattr__(field, value)
self[self._datamodel.get_field_position(field)] = value

def __getitem__(self, index):
Expand Down Expand Up @@ -269,7 +269,7 @@ def _cast_member_from_value(self, index, val):
return model.as_data(self._builder, val)


class Structure(object):
class Structure:
"""
A high-level object wrapping a alloca'ed LLVM structure, including
named fields and attribute access.
Expand Down Expand Up @@ -329,7 +329,7 @@ def __setattr__(self, field, value):
Store the LLVM *value* into the named *field*.
"""
if field.startswith("_"):
return super(Structure, self).__setattr__(field, value)
return super().__setattr__(field, value)
self[self._namemap[field]] = value

def __getitem__(self, index):
Expand Down
2 changes: 1 addition & 1 deletion numba_cuda/numba/cuda/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def run_frontend(func, inline_closures=False, emit_dels=False):
return func_ir


class DefaultPassBuilder(object):
class DefaultPassBuilder:
"""
This is the default pass builder, it contains the "classic" default
pipelines as pre-canned PassManager instances:
Expand Down
2 changes: 1 addition & 1 deletion numba_cuda/numba/cuda/core/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ def prune_by_predicate(branch, pred, blk):
taken = do_prune(take_truebr, blk)
return True, taken

class Unknown(object):
class Unknown:
pass

def resolve_input_arg_const(input_arg_idx):
Expand Down
2 changes: 1 addition & 1 deletion numba_cuda/numba/cuda/core/annotations/type_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def avail(self):
return bool(self.lines)


class TypeAnnotation(object):
class TypeAnnotation:
# func_data dict stores annotation data for all functions that are
# compiled. We store the data in the TypeAnnotation class since a new
# TypeAnnotation instance is created for each function that is compiled.
Expand Down
8 changes: 4 additions & 4 deletions numba_cuda/numba/cuda/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
void_ptr = GENERIC_POINTER


class OverloadSelector(object):
class OverloadSelector:
"""
An object matching an actual signature against a registry of formal
signatures and choosing the best candidate, if any.
Expand Down Expand Up @@ -151,7 +151,7 @@ def append(self, value, sig):
self._cache.clear()


class BaseContext(object):
class BaseContext:
"""

Notes on Structure
Expand Down Expand Up @@ -1271,7 +1271,7 @@ def get_ufunc_info(self, ufunc_key):
raise NotImplementedError(f"{self} does not support ufunc")


class _wrap_impl(object):
class _wrap_impl:
"""
A wrapper object to call an implementation function with some predefined
(context, signature) arguments.
Expand Down Expand Up @@ -1302,7 +1302,7 @@ def _has_loc(fn):
return "loc" in sig.parameters


class _wrap_missing_loc(object):
class _wrap_missing_loc:
def __init__(self, fn):
self.func = fn # store this to help with debug

Expand Down
2 changes: 1 addition & 1 deletion numba_cuda/numba/cuda/core/boxing.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ def box_list(typ, val, c):
return c.builder.load(res)


class _NumbaTypeHelper(object):
class _NumbaTypeHelper:
"""A helper for acquiring `numba.typeof` for type checking.

Usage
Expand Down
6 changes: 3 additions & 3 deletions numba_cuda/numba/cuda/core/bytecode.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def _as_opcodes(seq):
HAVE_ARGUMENT = dis.HAVE_ARGUMENT


class ByteCodeInst(object):
class ByteCodeInst:
"""
Attributes
----------
Expand Down Expand Up @@ -271,7 +271,7 @@ def _patched_opargs(bc_stream):
yield offset + _FIXED_OFFSET, opcode, arg, nextoffset + _FIXED_OFFSET


class ByteCodeIter(object):
class ByteCodeIter:
def __init__(self, code):
self.code = code
self.iter = iter(_patched_opargs(_unpack_opargs(self.code.co_code)))
Expand All @@ -298,7 +298,7 @@ def read_arg(self, size):
return buf


class _ByteCode(object):
class _ByteCode:
"""
The decoded bytecode of a function, and related information.
"""
Expand Down
14 changes: 7 additions & 7 deletions numba_cuda/numba/cuda/core/byteflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class CALL_INTRINSIC_1_Operand(Enum):


@total_ordering
class BlockKind(object):
class BlockKind:
"""Kinds of block to make related code safer than just `str`."""

_members = frozenset(
Expand Down Expand Up @@ -88,7 +88,7 @@ def __repr__(self):
return "BlockKind({})".format(self._value)


class Flow(object):
class Flow:
"""Data+Control Flow analysis.

Simulate execution to recover dataflow and controlflow information.
Expand Down Expand Up @@ -353,7 +353,7 @@ def _is_null_temp_reg(reg):
return reg.startswith("$null$")


class TraceRunner(object):
class TraceRunner:
"""Trace runner contains the states for the trace and the opcode dispatch."""

def __init__(self, debug_filename):
Expand Down Expand Up @@ -2118,7 +2118,7 @@ def op_LOAD_COMMON_CONSTANT(self, state, inst):


@total_ordering
class _State(object):
class _State:
"""State of the trace"""

def __init__(self, bytecode, pc, nstack, blockstack, nullvals=()):
Expand Down Expand Up @@ -2487,7 +2487,7 @@ def get_function_attributes(self, make_func_res):
Edge = namedtuple("Edge", ["pc", "stack", "blockstack", "npush"])


class AdaptDFA(object):
class AdaptDFA:
"""Adapt Flow to the old DFA class expected by Interpreter"""

def __init__(self, flow):
Expand Down Expand Up @@ -2543,7 +2543,7 @@ def _flatten_inst_regs(iterable):
yield x


class AdaptCFA(object):
class AdaptCFA:
"""Adapt Flow to the old CFA class expected by Interpreter"""

def __init__(self, flow):
Expand Down Expand Up @@ -2585,7 +2585,7 @@ def dump(self):
self._flow.cfgraph.dump()


class AdaptCFBlock(object):
class AdaptCFBlock:
def __init__(self, blockinfo, offset):
self.offset = offset
self.body = tuple(i for i, _ in blockinfo.insts)
6 changes: 3 additions & 3 deletions numba_cuda/numba/cuda/core/caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def flush(self):
pass


class IndexDataCacheFile(object):
class IndexDataCacheFile:
"""
Implements the logic for the index file and data file used by a cache.
"""
Expand Down Expand Up @@ -407,7 +407,7 @@ def get_suitable_cache_subpath(cls, py_file):
return "_".join([parentdir, hashed])


class _SourceFileBackedLocatorMixin(object):
class _SourceFileBackedLocatorMixin:
"""
A cache locator mixin for functions which are backed by a well-known
Python source file.
Expand Down Expand Up @@ -456,7 +456,7 @@ def get_cache_path(self):
return self._cache_path


class _SourceFileBackedLocatorMixin(object):
class _SourceFileBackedLocatorMixin:
"""
A cache locator mixin for functions which are backed by a well-known
Python source file.
Expand Down
6 changes: 3 additions & 3 deletions numba_cuda/numba/cuda/core/callconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def _const_int(code):
RETCODE_USEREXC = _const_int(FIRST_USEREXC)


class BaseCallConv(object):
class BaseCallConv:
def __init__(self, context):
self.context = context

Expand Down Expand Up @@ -293,7 +293,7 @@ def call_function(self, builder, callee, resty, argtys, args):
return status, out


class _MinimalCallHelper(object):
class _MinimalCallHelper:
"""
A call helper object for the "minimal" calling convention.
User exceptions are represented as integer codes and stored in
Expand Down Expand Up @@ -341,7 +341,7 @@ def get_exception(self, exc_id):
return exc, exc_args, locinfo


class ErrorModel(object):
class ErrorModel:
def __init__(self, call_conv):
self.call_conv = call_conv

Expand Down
4 changes: 2 additions & 2 deletions numba_cuda/numba/cuda/core/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from numba.cuda.core.targetconfig import ConfigStack


class _CompileStatus(object):
class _CompileStatus:
"""
Describes the state of compilation. Used like a C record.
"""
Expand Down Expand Up @@ -72,7 +72,7 @@ def _make_subtarget(targetctx, flags):
return targetctx.subtarget(**subtargetoptions)


class CompilerBase(object):
class CompilerBase:
"""
Stores and manages states for the compiler
"""
Expand Down
4 changes: 2 additions & 2 deletions numba_cuda/numba/cuda/core/compiler_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


# Lock for the preventing multiple compiler execution
class _CompilerLock(object):
class _CompilerLock:
def __init__(self):
self._lock = threading.RLock()

Expand Down Expand Up @@ -46,7 +46,7 @@ def _acquire_compile_lock(*args, **kwargs):


# Wrapper that coordinates both numba and numba-cuda compiler locks
class _DualCompilerLock(object):
class _DualCompilerLock:
"""Wrapper that coordinates both the numba-cuda and upstream numba compiler locks."""

def __init__(self, cuda_lock, numba_lock):
Expand Down
10 changes: 5 additions & 5 deletions numba_cuda/numba/cuda/core/compiler_machinery.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
_termcolor = errors.termcolor()


class SimpleTimer(object):
class SimpleTimer:
"""
A simple context managed timer
"""
Expand Down Expand Up @@ -111,7 +111,7 @@ def get_analysis(self, pass_name):
return self._analysis[pass_name]


class SSACompliantMixin(object):
class SSACompliantMixin:
"""Mixin to indicate a pass is SSA form compliant. Nothing is asserted
about this condition at present.
"""
Expand All @@ -137,7 +137,7 @@ class LoweringPass(CompilerPass):
pass


class AnalysisUsage(object):
class AnalysisUsage:
"""This looks and behaves like LLVM's AnalysisUsage because its like that."""

def __init__(self):
Expand Down Expand Up @@ -171,7 +171,7 @@ def debug_print(*args, **kwargs):
pass_timings = namedtuple("pass_timings", "init run finalize")


class PassManager(object):
class PassManager:
"""
The PassManager is a named instance of a particular compilation pipeline
"""
Expand Down Expand Up @@ -437,7 +437,7 @@ def walk(lkey, rmap):
pass_info = namedtuple("pass_info", "pass_inst mutates_CFG analysis_only")


class PassRegistry(object):
class PassRegistry:
"""
Pass registry singleton class.
"""
Expand Down
2 changes: 1 addition & 1 deletion numba_cuda/numba/cuda/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def _process_opt_level(opt_level):
return _OptLevel(opt_level)


class _EnvReloader(object):
class _EnvReloader:
def __init__(self):
self.reset()

Expand Down
2 changes: 1 addition & 1 deletion numba_cuda/numba/cuda/core/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from numba.cuda.core import ir


class ConstantInference(object):
class ConstantInference:
"""
A constant inference engine for a given interpreter.
Inference inspects the IR to try and compute a compile-time constant for
Expand Down
6 changes: 3 additions & 3 deletions numba_cuda/numba/cuda/core/controlflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
raise NotImplementedError(PYVERSION)


class CFBlock(object):
class CFBlock:
def __init__(self, offset):
self.offset = offset
self.body = []
Expand Down Expand Up @@ -93,7 +93,7 @@ def _non_empty_items(self):
return [(k, vs) for k, vs in sorted(self.items()) if vs]


class CFGraph(object):
class CFGraph:
"""
Generic (almost) implementation of a Control Flow Graph.
"""
Expand Down Expand Up @@ -749,7 +749,7 @@ def __ne__(self, other):
return not self.__eq__(other)


class ControlFlowAnalysis(object):
class ControlFlowAnalysis:
"""
Attributes
----------
Expand Down
Loading