mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Print some information to stderr when a CUDA kernel fails
This commit is contained in:
@@ -211,8 +211,12 @@ struct GpuDevice {
|
|||||||
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void synchronize() const {
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void synchronize() const {
|
||||||
#if defined(__CUDACC__) && !defined(__CUDA_ARCH__)
|
#if defined(__CUDACC__) && !defined(__CUDA_ARCH__)
|
||||||
cudaError_t err = cudaStreamSynchronize(stream_->stream());
|
cudaError_t err = cudaStreamSynchronize(stream_->stream());
|
||||||
EIGEN_UNUSED_VARIABLE(err)
|
if (err != cudaSuccess) {
|
||||||
assert(err == cudaSuccess);
|
std::cerr << "Error detected in CUDA stream: "
|
||||||
|
<< cudaGetErrorString(err)
|
||||||
|
<< std::endl;
|
||||||
|
assert(err == cudaSuccess);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
assert(false && "The default device should be used instead to generate kernel code");
|
assert(false && "The default device should be used instead to generate kernel code");
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user