()
| 20 | |
| 21 | # Demonstrate cupy array stays in scope when returning valid dlp |
| 22 | def scope_okay(): |
| 23 | a = cp.empty((3,3), dtype=cp.float32) |
| 24 | a[1,1] = 2 |
| 25 | dlp = a.__dlpack__() |
| 26 | assert(matxutil.check_dlpack_status(dlp) == 0) |
| 27 | return dlp |
| 28 | |
| 29 | #Do all cupy work using the "with stream" context manager |
| 30 | stream = cp.cuda.stream.Stream(non_blocking=True) |