@@ -90,16 +90,18 @@ class Array(ArrayBasic):
9090 to 'local'. Used to override `_mem_local` and `_mem_mapped`.
9191 scope : str, optional
9292 The scope in the given memory space. Allowed values: 'heap', 'stack',
93- 'static', 'constant', 'shared', 'shared-remote'. 'static' refers to a
94- static array in a C/C++ sense. 'constant' and 'shared' mean that the
95- Array represents an object allocated in so called constant and shared
96- memory, respectively, which are typical of device architectures. If
97- 'shared' is specified but the underlying architecture doesn't have
98- something akin to shared memory, the behaviour is unspecified. If
99- 'constant' is specified but the underlying architecture doesn't have
100- something akin to constant memory, the Array falls back to a global,
101- const, static array in a C/C++ sense. Note that not all scopes make
102- sense for a given space.
93+ 'static', 'constant', 'shared', 'shared-remote', 'registers'.
94+ 'static' refers to a static array in a C/C++ sense. 'constant' and
95+ 'shared' mean that the Array represents an object allocated in so
96+ called constant and shared memory, respectively, which are typical of
97+ device architectures. If 'shared' is specified but the underlying
98+ architecture doesn't have something akin to shared memory, the
99+ behaviour is unspecified. If 'constant' is specified but the underlying
100+ architecture doesn't have something akin to constant memory, the Array
101+ falls back to a global, const, static array in a C/C++ sense.
102+ 'registers' is used to indicate that the Array has a small static size
103+ and, as such, it could be allocated in registers. Defaults to 'heap'.
104+ Note that not all scopes make sense for a given space.
103105 grid : Grid, optional
104106 Only necessary for distributed-memory parallelism; a Grid contains
105107 information about the distributed Dimensions, hence it is necessary
@@ -133,7 +135,7 @@ def __init_finalize__(self, *args, **kwargs):
133135
134136 self ._scope = kwargs .get ('scope' , 'heap' )
135137 assert self ._scope in ['heap' , 'stack' , 'static' , 'constant' , 'shared' ,
136- 'shared-remote' ]
138+ 'shared-remote' , 'registers' ]
137139
138140 self ._initvalue = kwargs .get ('initvalue' )
139141 assert self ._initvalue is None or self ._scope != 'heap'
@@ -166,7 +168,7 @@ def _C_ctype(self):
166168
167169 @property
168170 def _mem_stack (self ):
169- return self ._scope in ('stack' , 'shared' )
171+ return self ._scope in ('stack' , 'shared' , 'registers' )
170172
171173 @property
172174 def _mem_heap (self ):
@@ -180,6 +182,10 @@ def _mem_shared(self):
180182 def _mem_shared_remote (self ):
181183 return self ._scope == 'shared-remote'
182184
185+ @property
186+ def _mem_registers (self ):
187+ return self ._scope == 'registers'
188+
183189 @property
184190 def _mem_constant (self ):
185191 return self ._scope == 'constant'
0 commit comments