44"""
55
66from collections import OrderedDict
7+ from ctypes import c_uint64
78from functools import singledispatch
89from operator import itemgetter
910
@@ -187,7 +188,7 @@ def _alloc_mapped_array_on_high_bw_mem(self, site, obj, storage, *args):
187188 arity_arg = sizeof_dtypeN / sizeof_dtype1
188189 ndims_param = Symbol (name = 'ndims' , dtype = size_t )
189190 ndims_arg = obj .ndim
190- shape_param = Array (name = f'{ obj .name } _shape' , dtype = np .uint64 ,
191+ shape_param = Array (name = f'{ obj .name } _shape' , dtype = np .int32 ,
191192 dimensions = (Dimension (name = 'd' ),), scope = 'rvalue' )
192193 shape_arg = ListInitializer (obj .c0 .symbolic_shape , dtype = shape_param .dtype )
193194
@@ -205,7 +206,7 @@ def _alloc_mapped_array_on_high_bw_mem(self, site, obj, storage, *args):
205206
206207 # Allocate the shape array
207208 memptr = VOID (Byref (ffp1 ), '**' )
208- nbytes = SizeOf (obj . _C_size_type )* ndims_param
209+ nbytes = SizeOf (c_uint64 )* ndims_param
209210 alloc1 = self .langbb ['host-alloc' ](memptr , alignment , nbytes )
210211
211212 # Initialize the Array metadata
@@ -289,7 +290,7 @@ def _alloc_bundle_struct_on_high_bw_mem(self, site, obj, storage):
289290
290291 # Allocate the shape array
291292 memptr = VOID (Byref (ffp1 ), '**' )
292- nbytes = SizeOf (obj . _C_size_type )* obj .ndim
293+ nbytes = SizeOf (c_uint64 )* obj .ndim
293294 alloc1 = self .langbb ['host-alloc' ](memptr , alignment , nbytes )
294295
295296 # Initialize the Bundle metadata
0 commit comments