Skip to content

Commit 7bb5e95

Browse files
DevmateHteNullableReturn Botfacebook-github-bot
authored andcommitted
fbcode/libspdl/cuda/storage.cpp (facebookresearch#1603)
Summary: Pull Request resolved: facebookresearch#1603 Reviewed By: frbng Differential Revision: D114253091
1 parent 1f3b9e5 commit 7bb5e95

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/libspdl/cuda/storage.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ uintptr_t default_allocator(int size, int device, uintptr_t) {
5151
TRACE_EVENT("decoding", "cudaMalloc");
5252
CHECK_CUDA(cudaMalloc(&data, size), "Failed to allocate CUDA memory");
5353
}
54+
if (data == nullptr) {
55+
SPDL_FAIL("CUDA memory allocation returned a null pointer.");
56+
}
5457
return reinterpret_cast<uintptr_t>(data);
5558
}
5659

0 commit comments

Comments
 (0)