| 2666 | // functions and logs for errors. |
| 2667 | template <typename... Args> |
| 2668 | struct ThenBlasImpl { |
| 2669 | // blas_func is the DoBlasXXX member function pointer, and args are its |
| 2670 | // arguments except the first one of Stream* type. |
| 2671 | Stream &operator()(Stream *stream, |
| 2672 | bool (blas::BlasSupport::*blas_func)(Stream *, Args...), |
| 2673 | Args... args) { |
| 2674 | return Run(stream, blas_func, /*record_error=*/true, args...); |
| 2675 | } |
| 2676 | |
| 2677 | // Like operator(), but only calls stream->CheckError() if record_error is |
| 2678 | // true. |
| 2679 | Stream &Run(Stream *stream, |
| 2680 | bool (blas::BlasSupport::*blas_func)(Stream *, Args...), |
| 2681 | bool record_error, Args... args); |
| 2682 | }; |
| 2683 | |
| 2684 | template <typename... Args> |
| 2685 | Stream &ThenBlasImpl<Args...>::Run( |