Frees the GPU memory associated with this array. You can also use a context manager to ensure that memory is freed. For example: :: with DeviceArray(...) as arr: ...
(self)
| 410 | self.free() |
| 411 | |
| 412 | def free(self): |
| 413 | """ |
| 414 | Frees the GPU memory associated with this array. |
| 415 | |
| 416 | You can also use a context manager to ensure that memory is freed. For example: |
| 417 | :: |
| 418 | |
| 419 | with DeviceArray(...) as arr: |
| 420 | ... |
| 421 | """ |
| 422 | wrapper().free(self.ptr) |
| 423 | self.shape = tuple() |
| 424 | self.allocated_nbytes = 0 |
| 425 | self.ptr = 0 |
| 426 | |
| 427 | def copy_from(self, host_buffer, stream=None): |
| 428 | """ |