1515from .index import *
1616
1717def create_array (buf , numdims , idims , dtype ):
18- out_arr = ct .c_longlong (0 )
19- ct . c_dims = dim4 (idims [0 ], idims [1 ], idims [2 ], idims [3 ])
20- safe_call (clib .af_create_array (ct .pointer (out_arr ), ct .c_longlong (buf ),\
21- numdims , ct .pointer (ct . c_dims ), dtype ))
18+ out_arr = ct .c_void_p (0 )
19+ c_dims = dim4 (idims [0 ], idims [1 ], idims [2 ], idims [3 ])
20+ safe_call (clib .af_create_array (ct .pointer (out_arr ), ct .c_void_p (buf ),
21+ numdims , ct .pointer (c_dims ), dtype ))
2222 return out_arr
2323
2424def constant_array (val , d0 , d1 = None , d2 = None , d3 = None , dtype = f32 ):
@@ -29,7 +29,7 @@ def constant_array(val, d0, d1=None, d2=None, d3=None, dtype=f32):
2929 else :
3030 raise TypeError ("Invalid dtype" )
3131
32- out = ct .c_longlong (0 )
32+ out = ct .c_void_p (0 )
3333 dims = dim4 (d0 , d1 , d2 , d3 )
3434
3535 if isinstance (val , complex ):
@@ -187,7 +187,7 @@ def __del__(self):
187187 clib .af_release_array (self .arr )
188188
189189 def device_ptr (self ):
190- ptr = ctypes .c_void_p (0 )
190+ ptr = ct .c_void_p (0 )
191191 clib .af_get_device_ptr (ct .pointer (ptr ), self .arr )
192192 return ptr .value
193193
@@ -445,7 +445,7 @@ def __setitem__(self, key, val):
445445 else :
446446 other_arr = val .arr
447447
448- out_arr = ct .c_longlong (0 )
448+ out_arr = ct .c_void_p (0 )
449449 inds = get_indices (key , n_dims )
450450
451451 safe_call (clib .af_assign_gen (ct .pointer (out_arr ),\
0 commit comments