Skip to content

Commit 762037d

Browse files
Merge pull request #205 from mesutoezdil/fix/dead-compute-calls-in-array-hooks
remove dead compute calls in array hooks
2 parents d7b689a + fde973b commit 762037d

1 file changed

Lines changed: 3 additions & 20 deletions

File tree

src/cuda/memory.c

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -95,36 +95,19 @@ uint64_t compute_array_alloc_bytes(const CUDA_ARRAY_DESCRIPTOR* desc) {
9595

9696
CUresult cuArray3DCreate_v2(CUarray* arr, const CUDA_ARRAY3D_DESCRIPTOR* desc) {
9797
LOG_DEBUG("cuArray3DCreate_v2");
98-
/*uint64_t bytes*/
99-
compute_3d_array_alloc_bytes(desc);
100-
CUresult res = CUDA_OVERRIDE_CALL(cuda_library_entry,cuArray3DCreate_v2, arr, desc);
101-
if (res != CUDA_SUCCESS) {
102-
return res;
103-
}
104-
return res;
98+
return CUDA_OVERRIDE_CALL(cuda_library_entry, cuArray3DCreate_v2, arr, desc);
10599
}
106100

107101

108102
CUresult cuArrayCreate_v2(CUarray* arr, const CUDA_ARRAY_DESCRIPTOR* desc) {
109103
LOG_DEBUG("cuArrayCreate_v2");
110-
/*uint64_t bytes*/
111-
compute_array_alloc_bytes(desc);
112-
CUresult res = CUDA_OVERRIDE_CALL(cuda_library_entry,cuArrayCreate_v2, arr, desc);
113-
if (res != CUDA_SUCCESS) {
114-
return res;
115-
}
116-
return res;
104+
return CUDA_OVERRIDE_CALL(cuda_library_entry, cuArrayCreate_v2, arr, desc);
117105
}
118106

119107

120108
CUresult cuArrayDestroy(CUarray arr) {
121-
CUDA_ARRAY3D_DESCRIPTOR desc;
122109
LOG_DEBUG("cuArrayDestroy");
123-
CHECK_DRV_API(cuArray3DGetDescriptor(&desc, arr));
124-
/*uint64_t bytes*/
125-
compute_3d_array_alloc_bytes(&desc);
126-
CUresult res = CUDA_OVERRIDE_CALL(cuda_library_entry,cuArrayDestroy, arr);
127-
return res;
110+
return CUDA_OVERRIDE_CALL(cuda_library_entry, cuArrayDestroy, arr);
128111
}
129112

130113
CUresult cuMemoryAllocate(CUdeviceptr* dptr, size_t bytesize, void* data) {

0 commit comments

Comments
 (0)