Commit 02bcae3
refactor(cuda): Deprecate CudaMemoryBufferView as internal implementation detail (Issue #4)
Marked CudaMemoryBufferView and CudaMemoryBufferView<T> as [Obsolete] and internal
to prevent direct usage of internal implementation details. These classes were only
used internally by CudaMemoryManager for buffer slicing operations.
Changes:
- CudaMemoryBufferView.cs: Added [Obsolete] attribute, changed to internal
- CudaMemoryBufferView<T>.cs: Added [Obsolete] attribute, changed to internal
- CudaMemoryManager.cs: Added #pragma warning disable CS0618 for intentional internal usage
- docs/BUFFER_VIEW_MIGRATION.md: Comprehensive migration guide and best practices
Impact:
- Zero breaking changes (classes were only used internally)
- No test coverage affected (no tests reference these classes)
- Build: 0 warnings, 0 errors
- Removal planned for v0.3.0
Technical Details:
Buffer views are non-owning references used for zero-copy slicing. Users should
always work through IUnifiedMemoryBuffer interface and IMemoryManager for all
buffer operations. Direct buffer view instantiation bypassed safety checks.
Migration Path:
Before: Direct CudaMemoryBufferView instantiation (incorrect)
After: Use IMemoryManager.CreateSlice() for buffer slicing (correct)
See docs/BUFFER_VIEW_MIGRATION.md for complete migration guide.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 3f3a8f7 commit 02bcae3
File tree
3 files changed
+180
-2
lines changed- docs
- src/Backends/DotCompute.Backends.CUDA/Memory
3 files changed
+180
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
78 | | - | |
| 79 | + | |
| 80 | + | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
650 | 650 | | |
651 | 651 | | |
652 | 652 | | |
| 653 | + | |
653 | 654 | | |
| 655 | + | |
654 | 656 | | |
655 | 657 | | |
656 | 658 | | |
| |||
671 | 673 | | |
672 | 674 | | |
673 | 675 | | |
| 676 | + | |
674 | 677 | | |
| 678 | + | |
675 | 679 | | |
676 | 680 | | |
677 | 681 | | |
| |||
812 | 816 | | |
813 | 817 | | |
814 | 818 | | |
| 819 | + | |
815 | 820 | | |
816 | 821 | | |
817 | 822 | | |
818 | 823 | | |
819 | 824 | | |
820 | 825 | | |
821 | 826 | | |
| 827 | + | |
822 | 828 | | |
823 | 829 | | |
824 | 830 | | |
825 | 831 | | |
826 | 832 | | |
827 | 833 | | |
828 | 834 | | |
| 835 | + | |
829 | 836 | | |
830 | 837 | | |
831 | 838 | | |
832 | 839 | | |
833 | 840 | | |
834 | 841 | | |
| 842 | + | |
835 | 843 | | |
836 | 844 | | |
837 | 845 | | |
0 commit comments