Skip to content

Commit a7cfdfd

Browse files
committed
Add array.device_ptr
1 parent bb6328b commit a7cfdfd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

arrayfire/array.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,11 @@ def __del__(self):
186186
if (self.arr.value != 0):
187187
clib.af_release_array(self.arr)
188188

189+
def device_ptr(self):
190+
ptr = ctypes.c_void_p(0)
191+
clib.af_get_device_ptr(ct.pointer(ptr), self.arr)
192+
return ptr.value
193+
189194
def elements(self):
190195
num = ct.c_ulonglong(0)
191196
safe_call(clib.af_get_elements(ct.pointer(num), self.arr))

0 commit comments

Comments
 (0)