Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

[SYCL] Fix CUDA tests using bfloat16 #1421

Merged
merged 2 commits into from
Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions SYCL/BFloat16/bfloat16_builtins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

using namespace sycl;
using namespace sycl::ext::oneapi;
using namespace sycl::ext::oneapi::experimental;

constexpr int N = 60; // divisible by all tested array sizes
constexpr float bf16_eps = 0.00390625;
Expand Down
1 change: 1 addition & 0 deletions SYCL/Matrix/element_wise_all_ops_bf16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

using namespace sycl;
using namespace sycl::ext::intel;
using namespace sycl::ext::oneapi;
using namespace sycl::ext::oneapi::experimental::matrix;

#define SG_SZ 16
Expand Down
5 changes: 0 additions & 5 deletions SYCL/Matrix/joint_matrix_tensorcores_legacy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,8 @@ T2 matrix_ref_mn(const int &m, const int &n, T1 *A, T1 *B, T2 *C) {
if constexpr (std::is_same<T1, uint16_t>::value) {
for (int k = 0; k < Big_K; k++)
res += make_fp32(A[m * Big_K + k]) * make_fp32(B[k * Big_N + n]);
} else if constexpr (std::is_same<T1, bfloat16>::value) {
for (int k = 0; k < Big_K; k++)
res +=
make_fp32(A[m * Big_K + k].raw()) * make_fp32(B[k * Big_N + n].raw());
} else {
for (int k = 0; k < Big_K; k++)

res +=
static_cast<T2>(A[m * Big_K + k]) * static_cast<T2>(B[k * Big_N + n]);
}
Expand Down