Skip to content
This repository was archived by the owner on Jan 25, 2023. It is now read-only.

Patch for addrspace #92

Closed
Closed
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
2 changes: 1 addition & 1 deletion numba/core/datamodel/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ def __init__(self, dmm, fe_type):
('parent', types.pyobject),
('nitems', types.intp),
('itemsize', types.intp),
('data', types.CPointer(fe_type.dtype, addrspace=fe_type.addrspace)),
('data', types.CPointer(fe_type.dtype)),
('shape', types.UniTuple(types.intp, ndim)),
('strides', types.UniTuple(types.intp, ndim)),

Expand Down
3 changes: 1 addition & 2 deletions numba/core/types/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Buffer(IterableType, ArrayCompatible):
# CS and FS are not reserved for inner contig but strided
LAYOUTS = frozenset(['C', 'F', 'CS', 'FS', 'A'])

def __init__(self, dtype, ndim, layout, readonly=False, name=None, addrspace=None):
def __init__(self, dtype, ndim, layout, readonly=False, name=None):
from .misc import unliteral

if isinstance(dtype, Buffer):
Expand All @@ -55,7 +55,6 @@ def __init__(self, dtype, ndim, layout, readonly=False, name=None, addrspace=Non
self.dtype = unliteral(dtype)
self.ndim = ndim
self.layout = layout
self.addrspace = addrspace
if readonly:
self.mutable = False
if name is None:
Expand Down
5 changes: 2 additions & 3 deletions numba/core/types/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,14 @@ class CPointer(Type):
"""
mutable = True

def __init__(self, dtype, addrspace=None):
def __init__(self, dtype):
self.dtype = dtype
self.addrspace = addrspace
name = "%s*" % dtype
super(CPointer, self).__init__(name)

@property
def key(self):
return self.dtype, self.addrspace
return self.dtype


class EphemeralPointer(CPointer):
Expand Down
12 changes: 5 additions & 7 deletions numba/core/types/npytypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ class Array(Buffer):
"""

def __init__(self, dtype, ndim, layout, readonly=False, name=None,
aligned=True, addrspace=None):
aligned=True):
if readonly:
self.mutable = False
if (not aligned or
Expand All @@ -408,7 +408,7 @@ def __init__(self, dtype, ndim, layout, readonly=False, name=None,
if not self.aligned:
type_name = "unaligned " + type_name
name = "%s(%s, %sd, %s)" % (type_name, dtype, ndim, layout)
super(Array, self).__init__(dtype, ndim, layout, name=name, addrspace=addrspace)
super(Array, self).__init__(dtype, ndim, layout, name=name)

@property
def mangling_args(self):
Expand All @@ -417,7 +417,7 @@ def mangling_args(self):
'aligned' if self.aligned else 'unaligned']
return self.__class__.__name__, args

def copy(self, dtype=None, ndim=None, layout=None, readonly=None, addrspace=None):
def copy(self, dtype=None, ndim=None, layout=None, readonly=None):
if dtype is None:
dtype = self.dtype
if ndim is None:
Expand All @@ -426,14 +426,12 @@ def copy(self, dtype=None, ndim=None, layout=None, readonly=None, addrspace=None
layout = self.layout
if readonly is None:
readonly = not self.mutable
if addrspace is None:
addrspace = self.addrspace
return Array(dtype=dtype, ndim=ndim, layout=layout, readonly=readonly,
aligned=self.aligned, addrspace=addrspace)
aligned=self.aligned)

@property
def key(self):
return self.dtype, self.ndim, self.layout, self.mutable, self.aligned, self.addrspace
return self.dtype, self.ndim, self.layout, self.mutable, self.aligned

def unify(self, typingctx, other):
"""
Expand Down