Skip to content

Commit 4db43c6

Browse files
committed
Naive implement cblas
1 parent 60d6348 commit 4db43c6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

paddle/fluid/operators/math/blas_impl.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,23 @@ struct CBlas;
2424

2525
template <>
2626
struct CBlas<float> {
27-
static constexpr auto GEMM = cblas_sgemm;
27+
template <typename... ARGS>
28+
static void GEMM(ARGS... args) {
29+
cblas_sgemm(args...);
30+
}
2831
};
2932

3033
template <>
3134
struct CBlas<double> {
32-
static constexpr auto GEMM = cblas_dgemm;
35+
template <typename... ARGS>
36+
static void GEMM(ARGS... args) {
37+
cblas_dgemm(args...);
38+
}
3339
};
3440

3541
template <>
3642
struct CBlas<platform::float16> {
37-
void GEMM(...) { PADDLE_THROW("float16 GEMM not supported on CPU"); }
43+
static void GEMM(...) { PADDLE_THROW("float16 GEMM not supported on CPU"); }
3844
};
3945

4046
template <>

0 commit comments

Comments
 (0)