File tree 1 file changed +8
-12
lines changed
1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -57,9 +57,14 @@ when defined(cuda):
57
57
offset* : int
58
58
storage* : CudaStorage [T]
59
59
60
- proc deallocCuda * [T](p: CudaTensorRefTracker [T]) {.noSideEffect .}=
61
- if not p.value.isNil:
62
- check cudaFree (p.value)
60
+ when NimMajor == 1 :
61
+ proc `=destroy` * [T](p: var CudaTensorRefTrackerObj [T]) {.noSideEffect .}=
62
+ if not p.value.isNil:
63
+ discard cudaFree (p.value)
64
+ else :
65
+ proc `=destroy` * [T](p: CudaTensorRefTrackerObj [T]) {.noSideEffect .}=
66
+ if not p.value.isNil:
67
+ discard cudaFree (p.value)
63
68
64
69
when defined (opencl):
65
70
type
@@ -96,15 +101,6 @@ else:
96
101
97
102
type GpuTensor [T] = AnyTensor [T] and not Tensor [T]
98
103
99
- when NimMajor == 1 :
100
- proc `=destroy` * [T](p: var CudaTensorRefTrackerObj [T]) {.noSideEffect .}=
101
- if not p.value.isNil:
102
- discard cudaFree (p.value)
103
- else :
104
- proc `=destroy` * [T](p: CudaTensorRefTrackerObj [T]) {.noSideEffect .}=
105
- if not p.value.isNil:
106
- discard cudaFree (p.value)
107
-
108
104
109
105
110
106
# ###############
You can’t perform that action at this time.
0 commit comments