| 399 | |
| 400 | template <typename FuncT, typename... Args> |
| 401 | bool ROCMBlas::DoBlasInternalImpl(FuncT rocblas_func, Stream *stream, |
| 402 | bool pointer_mode_host, bool err_on_failure, |
| 403 | Args... args) { |
| 404 | absl::MutexLock lock{&mu_}; |
| 405 | |
| 406 | CHECK(blas_ != nullptr); |
| 407 | if (!SetStream(stream)) { |
| 408 | return false; |
| 409 | } |
| 410 | |
| 411 | rocblas_status ret = rocblas_func(parent_, blas_, args...); |
| 412 | if (err_on_failure && ret != rocblas_status_success) { |
| 413 | LOG(ERROR) << "failed to run ROCBLAS routine " << rocblas_func.kName << ": " |
| 414 | << ToString(ret); |
| 415 | } |
| 416 | return ret == rocblas_status_success; |
| 417 | } |
| 418 | |
| 419 | bool ROCMBlas::DoBlasAsum(Stream *stream, uint64 elem_count, |
| 420 | const DeviceMemory<float> &x, int incx, |