Skip to content

Commit f18515f

Browse files
committed
Improving the documentation of raw_ptr() and device_ptr()
1 parent cf28938 commit f18515f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

arrayfire/array.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,8 @@ def device_ptr(self):
489489
----
490490
- This can be used to integrate with custom C code and / or PyCUDA or PyOpenCL.
491491
- No other arrays will share the same device pointer.
492-
- If multiple arrays share the same memory a copy of the memory is done and a pointer to the new copy is returned.
492+
- A copy of the memory is done if multiple arrays share the same memory or the array is not the owner of the memory.
493+
- In case of a copy the return value points to the newly allocated memory which is now exclusively owned by the array.
493494
"""
494495
ptr = ct.c_void_p(0)
495496
backend.get().af_get_device_ptr(ct.pointer(ptr), self.arr)
@@ -509,6 +510,8 @@ def raw_ptr(self):
509510
- This can be used to integrate with custom C code and / or PyCUDA or PyOpenCL.
510511
- No mem copy is peformed, this function returns the raw device pointer.
511512
- This pointer may be shared with other arrays. Use this function with caution.
513+
- In particular the JIT compiler will not be aware of the shared arrays.
514+
- This results in JITed operations not being immediately visible through the other array.
512515
"""
513516
ptr = ct.c_void_p(0)
514517
backend.get().af_get_raw_ptr(ct.pointer(ptr), self.arr)

0 commit comments

Comments
 (0)