We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b718b9a commit 8b14573Copy full SHA for 8b14573
1 file changed
src/kernels/fill.cu
@@ -17,6 +17,8 @@ __global__ void fill_kernel(floatX* dst, floatX value, std::size_t count) {
17
18
template<typename floatX>
19
void fill_imp(floatX* dst, floatX value, std::size_t count, cudaStream_t stream) {
20
+ if (count == 0) return;
21
+ if (dst == nullptr) throw std::invalid_argument("dst is nullptr");
22
fill_kernel<<<div_ceil(count, static_cast<std::size_t>(256)), 256, 0, stream>>> (dst, value, count);
23
CUDA_CHECK(cudaGetLastError());
24
}
0 commit comments