Add a mutex in cuda_solvers GetrfImpl. ()

* Add a mutex in cuda_solvers GetrfImpl.

The NVIDIA documentation claims the cuSolverDn functions
are thread-safe. However, issue  gives an example
of code where two threads simultaneously call GetrfImpl
and a segmentation fault occurs. Although one can not prove
the bug is in the NVIDIA code, this is most likely the case.

Note that GetrsImpl was already protected by a lock
for a similar reason.

* Revert changes to cuda_solvers.

The mutex was already added by a different commit.
This commit is contained in:
codrut3 2017-12-29 03:38:27 +02:00 committed by drpngx
parent c17d085f34
commit 3629fc4e98

View File

@ -210,7 +210,7 @@ class MatrixInverseOpGpu : public AsyncOpKernel {
done);
}
} else {
// For large matrices, we wompute the inverse of each matrix in the batch
// For large matrices, we compute the inverse of each matrix in the batch
// sequentially. Here we use the cuSolver methods GETRF/GETRS because they
// are MUCH faster than their batched cuBlas equivalents for large
// matrices.