From 28974a1ec3b921809c20a1217178da3792e5c545 Mon Sep 17 00:00:00 2001 From: PyTorch MergeBot Date: Fri, 18 Apr 2025 18:10:45 +0000 Subject: [PATCH] Revert "[Easy] Fix the compilation warning of BlasKernel. (#151302)" This reverts commit 32c79da789af84312a0db2de19211a7c57196ba7. Reverted https://github.com/pytorch/pytorch/pull/151302 on behalf of https://github.com/malfet due to Breaks builds without OpenMP, see https://github.com/pytorch/pytorch/issues/151680 ([comment](https://github.com/pytorch/pytorch/pull/151302#issuecomment-2815954855)) --- aten/src/ATen/native/BlasKernel.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/aten/src/ATen/native/BlasKernel.cpp b/aten/src/ATen/native/BlasKernel.cpp index b200415c9c3..bea1fb1d3f4 100644 --- a/aten/src/ATen/native/BlasKernel.cpp +++ b/aten/src/ATen/native/BlasKernel.cpp @@ -116,6 +116,18 @@ void fp16_gemv_trans( fp16_gemv_trans_stub(kCPU, m, n, alpha, a, lda, x, incx, beta, y, incy); } +static void bf16_gemv_trans( + const int m, + const int n, + const at::BFloat16 alpha, + const at::BFloat16* a, + const int lda, + const at::BFloat16* x, + const int incx, + const at::BFloat16 beta, + at::BFloat16* y, + const int incy); + #endif // !defined(C10_MOBILE) #if defined(__aarch64__) && !defined(C10_MOBILE) @@ -246,6 +258,10 @@ template <> void gemv_fast_path(const char *trans, const int *m, const int *n, const float *alpha, const float *a, const int *lda, const float *x, const int *incx, const float *beta, float *y, const int *incy) { sgemv_(remove_const(trans), remove_const(m), remove_const(n), remove_const(alpha), remove_const(a), remove_const(lda), remove_const(x), remove_const(incx), remove_const(beta), y, remove_const(incy)); } +#else +INSTANTIATE(float) +INSTANTIATE(double) +#endif // AT_BUILD_WITH_BLAS INSTANTIATE(uint8_t) INSTANTIATE(int8_t) @@ -267,7 +283,7 @@ bool gemv_use_fast_path( beta == 0.0; } -static void bf16_gemv_trans( +void bf16_gemv_trans( const int m, const int n, const at::BFloat16 alpha, @@ -495,7 +511,6 @@ void gemv_fast_path( INSTANTIATE(c10::Half) INSTANTIATE(c10::BFloat16) #endif // !defined(C10_MOBILE) -#endif // AT_BUILD_WITH_BLAS #undef INSTANTIATE } // namespace blas_impl