Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL][Matrix tests] Missing general double type case in initialization and ref compute #12800

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Changes from all commits
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
7 changes: 5 additions & 2 deletions sycl/test-e2e/Matrix/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ void matrix_multiply_ref(Ta *A, Tb *B, Tc *C, int M, int N, int K,
acc += make_fp32(va[i]) * make_fp32(vb[i]);
else if constexpr (std::is_same_v<Ta, float> &&
std::is_same_v<Tc, float> ||
std::is_integral_v<Ta> && std::is_integral_v<Tc>)
std::is_integral_v<Ta> && std::is_integral_v<Tc> ||
(std::is_same_v<Ta, double> &&
std::is_same_v<Tc, double>))
Comment on lines +68 to +69
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
(std::is_same_v<Ta, double> &&
std::is_same_v<Tc, double>))
std::is_same_v<Ta, double> &&
std::is_same_v<Tc, double>)

acc += va[i] * vb[i];
else if constexpr (std::is_same_v<Ta, sycl::half> &&
std::is_same_v<Tc, float>)
Expand Down Expand Up @@ -127,7 +129,8 @@ void matrix_rand(unsigned int rows, unsigned int cols, T *src, T val) {

for (unsigned int i = 0; i < rows; i++) {
for (unsigned int j = 0; j < cols; j++) {
if constexpr (std::is_same_v<T, bfloat16> || std::is_same_v<T, float>) {
if constexpr (std::is_same_v<T, bfloat16> || std::is_same_v<T, float> ||
std::is_same_v<T, double>) {
Copy link
Contributor

@YuriPlyakhin YuriPlyakhin Feb 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: do we want to use std::uniform_real_distribution<double> for double type?

src[i * cols + j] = T(fdistr(dev));
} else if constexpr (std::is_same_v<T, int8_t> ||
std::is_same_v<T, int32_t>) {
Expand Down
Loading