Commit 0af8901
committed
Add dpctl::memory::usm_memory constructor from external allocation
usm_memory(
void *usm_ptr,
size_t nbytes,
sycl::queue &q,
std::shared_ptr<void> shptr)
usm_ptr: Pointer to USM allocation
nbytes: is the size of allocation in bytes
q : sycl::queue associated with this allocation in Python.
shptr: Smart pointer with custom deleter that deallocates
the USM allocation.
Implementation notes:
Use unique_ptr to manage lifetime of new copy of sycl::queue,
Delegate newly created Python object memory management
to a unique_ptr to ensure it gets properly handled in case
an exception is thrown.1 parent b9242f4 commit 0af8901
1 file changed
+49
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
748 | 749 | | |
749 | 750 | | |
750 | 751 | | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
751 | 800 | | |
752 | 801 | | |
753 | 802 | | |
| |||
0 commit comments