Skip to content

Commit 04988b1

Browse files
trivialfisapmorton
andauthored
[backport] Clear CUDA error before pointer check (dmlc#11386) (dmlc#11577)
Co-authored-by: Austin Morton <[email protected]>
1 parent 6b98882 commit 04988b1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/data/array_interface.cu

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ bool ArrayInterfaceHandler::IsCudaPtr(void const* ptr) {
3838
if (!ptr) {
3939
return false;
4040
}
41+
// clear potentially pre-existing/unrelated error
42+
cudaGetLastError();
4143
cudaPointerAttributes attr;
4244
auto err = cudaPointerGetAttributes(&attr, ptr);
4345
// reset error

0 commit comments

Comments
 (0)