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

[SYCLomatic] Support more gemm_batch data type combinations when using opensource oneMKL and fix a type casting bug #2121

Merged
merged 5 commits into from
Jul 16, 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
29 changes: 17 additions & 12 deletions clang/runtime/dpct-rt/include/dpct/blas_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1846,6 +1846,7 @@ inline void gemm_batch(descriptor_ptr desc_ptr, oneapi::mkl::transpose a_trans,
ldc, batch_size, cm);
break;
}
#endif
case dpct::detail::get_type_combination_id(
library_data_t::real_int8, library_data_t::real_int8,
library_data_t::real_int32, library_data_t::real_int32): {
Expand All @@ -1854,28 +1855,27 @@ inline void gemm_batch(descriptor_ptr desc_ptr, oneapi::mkl::transpose a_trans,
float beta_float =
dpct::get_value(reinterpret_cast<const std::int32_t *>(beta), q);
dpct::detail::gemm_batch_impl<std::int8_t, std::int8_t, std::int32_t,
float>(q, a_trans, b_trans, m, n, k,
&alpha_float, a, lda, b, ldb,
&beta_float, c, ldc, batch_size, cm);
float>(
q, a_trans, b_trans, m, n, k, &alpha_float, a, lda, b, ldb, &beta_float,
c, ldc, batch_size DPCT_COMPUTE_MODE_ARG);
break;
}
case dpct::detail::get_type_combination_id(
library_data_t::real_int8, library_data_t::real_int8,
library_data_t::real_float, library_data_t::real_float): {
dpct::detail::gemm_batch_impl<std::int8_t, std::int8_t, float, float>(
q, a_trans, b_trans, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc,
batch_size, cm);
batch_size DPCT_COMPUTE_MODE_ARG);
break;
}
case dpct::detail::get_type_combination_id(
library_data_t::real_half, library_data_t::real_half,
library_data_t::real_float, library_data_t::real_float): {
dpct::detail::gemm_batch_impl<sycl::half, sycl::half, float, float>(
q, a_trans, b_trans, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc,
batch_size, cm);
batch_size DPCT_COMPUTE_MODE_ARG);
break;
}
#endif
case dpct::detail::get_type_combination_id(
library_data_t::real_half, library_data_t::real_half,
library_data_t::real_half, library_data_t::real_float): {
Expand Down Expand Up @@ -2024,32 +2024,37 @@ inline void gemm_batch(descriptor_ptr desc_ptr, oneapi::mkl::transpose a_trans,
beta, c, ldc, stride_c, batch_size, cm);
break;
}
#endif
case dpct::detail::get_type_combination_id(
library_data_t::real_int8, library_data_t::real_int8,
library_data_t::real_int32, library_data_t::real_int32): {
float alpha_float =
dpct::get_value(reinterpret_cast<const std::int32_t *>(alpha), q);
float beta_float =
dpct::get_value(reinterpret_cast<const std::int32_t *>(beta), q);
dpct::detail::gemm_batch_impl<std::int8_t, std::int8_t, std::int32_t,
std::int32_t>(
q, a_trans, b_trans, m, n, k, alpha, a, lda, stride_a, b, ldb, stride_b,
beta, c, ldc, stride_c, batch_size, cm);
float>(
q, a_trans, b_trans, m, n, k, &alpha_float, a, lda, stride_a, b, ldb,
stride_b, &beta_float, c, ldc, stride_c,
batch_size DPCT_COMPUTE_MODE_ARG);
break;
}
case dpct::detail::get_type_combination_id(
library_data_t::real_int8, library_data_t::real_int8,
library_data_t::real_float, library_data_t::real_float): {
dpct::detail::gemm_batch_impl<std::int8_t, std::int8_t, float, float>(
q, a_trans, b_trans, m, n, k, alpha, a, lda, stride_a, b, ldb, stride_b,
beta, c, ldc, stride_c, batch_size, cm);
beta, c, ldc, stride_c, batch_size DPCT_COMPUTE_MODE_ARG);
break;
}
case dpct::detail::get_type_combination_id(
library_data_t::real_half, library_data_t::real_half,
library_data_t::real_float, library_data_t::real_float): {
dpct::detail::gemm_batch_impl<sycl::half, sycl::half, float, float>(
q, a_trans, b_trans, m, n, k, alpha, a, lda, stride_a, b, ldb, stride_b,
beta, c, ldc, stride_c, batch_size, cm);
beta, c, ldc, stride_c, batch_size DPCT_COMPUTE_MODE_ARG);
break;
}
#endif
case dpct::detail::get_type_combination_id(
library_data_t::real_half, library_data_t::real_half,
library_data_t::real_half, library_data_t::real_float): {
Expand Down