@@ -90,15 +90,16 @@ 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'. 'static' refers to a static array in a
94- C/C++ sense. 'constant' and 'shared' mean that the Array represents an
95- object allocated in so called constant and shared memory, respectively,
96- which are typical of device architectures. If 'shared' is specified but
97- the underlying architecture doesn't have something akin to shared memory,
98- the behaviour is unspecified. If 'constant' is specified but the underlying
99- architecture doesn't have something akin to constant memory, the Array
100- falls back to a global, const, static array in a C/C++ sense.
101- Note that not all scopes make sense for a given space.
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.
102103 grid : Grid, optional
103104 Only necessary for distributed-memory parallelism; a Grid contains
104105 information about the distributed Dimensions, hence it is necessary
@@ -131,7 +132,8 @@ def __init_finalize__(self, *args, **kwargs):
131132 super ().__init_finalize__ (* args , ** kwargs )
132133
133134 self ._scope = kwargs .get ('scope' , 'heap' )
134- assert self ._scope in ['heap' , 'stack' , 'static' , 'constant' , 'shared' ]
135+ assert self ._scope in ['heap' , 'stack' , 'static' , 'constant' , 'shared' ,
136+ 'shared-remote' ]
135137
136138 self ._initvalue = kwargs .get ('initvalue' )
137139 assert self ._initvalue is None or self ._scope != 'heap'
@@ -174,6 +176,10 @@ def _mem_heap(self):
174176 def _mem_shared (self ):
175177 return self ._scope == 'shared'
176178
179+ @property
180+ def _mem_shared_remote (self ):
181+ return self ._scope == 'shared-remote'
182+
177183 @property
178184 def _mem_constant (self ):
179185 return self ._scope == 'constant'
@@ -445,9 +451,10 @@ def initvalue(self):
445451
446452 for i in ('_mem_internal_eager' , '_mem_internal_lazy' , '_mem_local' ,
447453 '_mem_mapped' , '_mem_host' , '_mem_stack' , '_mem_constant' ,
448- '_mem_shared' , '__padding_dtype__' , '_size_domain' , '_size_halo' ,
449- '_size_owned' , '_size_padding' , '_size_nopad' , '_size_nodomain' ,
450- '_offset_domain' , '_offset_halo' , '_offset_owned' , '_dist_dimensions' ,
454+ '_mem_shared' , '_mem_shared_remote' , '__padding_dtype__' ,
455+ '_size_domain' , '_size_halo' , '_size_owned' , '_size_padding' ,
456+ '_size_nopad' , '_size_nodomain' , '_offset_domain' ,
457+ '_offset_halo' , '_offset_owned' , '_dist_dimensions' ,
451458 '_C_get_field' , 'grid' , 'symbolic_shape' ,
452459 * AbstractFunction .__properties__ ):
453460 locals ()[i ] = property (lambda self , v = i : getattr (self .c0 , v ))
0 commit comments