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

Add new batch_gemm types #466

Merged
merged 30 commits into from
Jun 24, 2024
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Clang-foramt
  • Loading branch information
Aidan committed Jun 5, 2024
commit f9d2b85a0a94505b589fed23f028e76eff118fbb
32 changes: 14 additions & 18 deletions src/blas/function_table.hpp
Original file line number Diff line number Diff line change
@@ -3331,24 +3331,20 @@ typedef struct {
std::int64_t lda, std::int64_t stride_a, sycl::buffer<sycl::half, 1> &b, std::int64_t ldb,
std::int64_t stride_b, float beta, sycl::buffer<float, 1> &c, std::int64_t ldc,
std::int64_t stride_c, std::int64_t batch_size);
void (*row_major_gemm_s8s8f32_batch_strided_sycl)(sycl::queue &queue, oneapi::mkl::transpose transa,
oneapi::mkl::transpose transb, std::int64_t m,
std::int64_t n, std::int64_t k, float alpha,
sycl::buffer<std::int8_t, 1> &a, std::int64_t lda,
std::int64_t stride_a,
sycl::buffer<std::int8_t, 1> &b, std::int64_t ldb,
std::int64_t stride_b, float beta,
sycl::buffer<float, 1> &c, std::int64_t ldc,
std::int64_t stride_c, std::int64_t batch_size);
void (*row_major_gemm_s8s8s32_batch_strided_sycl)(sycl::queue &queue, oneapi::mkl::transpose transa,
oneapi::mkl::transpose transb, std::int64_t m,
std::int64_t n, std::int64_t k, float alpha,
sycl::buffer<std::int8_t, 1> &a, std::int64_t lda,
std::int64_t stride_a,
sycl::buffer<std::int8_t, 1> &b, std::int64_t ldb,
std::int64_t stride_b, float beta,
sycl::buffer<std::int32_t, 1> &c, std::int64_t ldc,
std::int64_t stride_c, std::int64_t batch_size);
void (*row_major_gemm_s8s8f32_batch_strided_sycl)(
sycl::queue &queue, oneapi::mkl::transpose transa, oneapi::mkl::transpose transb,
std::int64_t m, std::int64_t n, std::int64_t k, float alpha,
sycl::buffer<std::int8_t, 1> &a, std::int64_t lda, std::int64_t stride_a,
sycl::buffer<std::int8_t, 1> &b, std::int64_t ldb, std::int64_t stride_b, float beta,
sycl::buffer<float, 1> &c, std::int64_t ldc, std::int64_t stride_c,
std::int64_t batch_size);
void (*row_major_gemm_s8s8s32_batch_strided_sycl)(
sycl::queue &queue, oneapi::mkl::transpose transa, oneapi::mkl::transpose transb,
std::int64_t m, std::int64_t n, std::int64_t k, float alpha,
sycl::buffer<std::int8_t, 1> &a, std::int64_t lda, std::int64_t stride_a,
sycl::buffer<std::int8_t, 1> &b, std::int64_t ldb, std::int64_t stride_b, float beta,
sycl::buffer<std::int32_t, 1> &c, std::int64_t ldc, std::int64_t stride_c,
std::int64_t batch_size);
void (*row_major_strsm_batch_strided_sycl)(
sycl::queue &queue, oneapi::mkl::side left_right, oneapi::mkl::uplo upper_lower,
oneapi::mkl::transpose trans, oneapi::mkl::diag unit_diag, std::int64_t m, std::int64_t n,
6 changes: 4 additions & 2 deletions tests/unit_tests/blas/batch/gemm_batch_stride.cpp
Original file line number Diff line number Diff line change
@@ -66,7 +66,8 @@ int test(device *dev, oneapi::mkl::layout layout, int64_t batch_size) {
alpha = rand_scalar<Ts>();
beta = rand_scalar<Ts>();

if ((std::is_same<Ts, std::complex<float>>::value) || (std::is_same<Ts, std::complex<double>>::value)) {
if ((std::is_same<Ts, std::complex<float>>::value) ||
(std::is_same<Ts, std::complex<double>>::value)) {
tmp = std::rand() % 3;
if (tmp == 2)
transa = oneapi::mkl::transpose::conjtrans;
@@ -77,7 +78,8 @@ int test(device *dev, oneapi::mkl::layout layout, int64_t batch_size) {
transb = oneapi::mkl::transpose::conjtrans;
else
transb = (oneapi::mkl::transpose)tmp;
} else {
}
else {
transa = (oneapi::mkl::transpose)(std::rand() % 2);
transb = (oneapi::mkl::transpose)(std::rand() % 2);
}
6 changes: 4 additions & 2 deletions tests/unit_tests/blas/batch/gemm_batch_stride_usm.cpp
Original file line number Diff line number Diff line change
@@ -85,7 +85,8 @@ int test(device *dev, oneapi::mkl::layout layout, int64_t batch_size) {
ldc = std::max(m, n);
alpha = rand_scalar<Ts>();
beta = rand_scalar<Ts>();
if ((std::is_same<Ts, std::complex<float>>::value) || (std::is_same<Ts, std::complex<double>>::value)) {
if ((std::is_same<Ts, std::complex<float>>::value) ||
(std::is_same<Ts, std::complex<double>>::value)) {
tmp = std::rand() % 3;
if (tmp == 2)
transa = oneapi::mkl::transpose::conjtrans;
@@ -96,7 +97,8 @@ int test(device *dev, oneapi::mkl::layout layout, int64_t batch_size) {
transb = oneapi::mkl::transpose::conjtrans;
else
transb = (oneapi::mkl::transpose)tmp;
} else {
}
else {
transa = (oneapi::mkl::transpose)(std::rand() % 2);
transb = (oneapi::mkl::transpose)(std::rand() % 2);
}
6 changes: 4 additions & 2 deletions tests/unit_tests/blas/batch/gemm_batch_usm.cpp
Original file line number Diff line number Diff line change
@@ -106,7 +106,8 @@ int test(device *dev, oneapi::mkl::layout layout, int64_t group_count) {
ldc[i] = std::max(m[i], n[i]);
alpha[i] = rand_scalar<Ts>();
beta[i] = rand_scalar<Ts>();
if ((std::is_same<Ts, std::complex<float>>::value) || (std::is_same<Ts, std::complex<double>>::value)) {
if ((std::is_same<Ts, std::complex<float>>::value) ||
(std::is_same<Ts, std::complex<double>>::value)) {
tmp = std::rand() % 3;
if (tmp == 2)
transa[i] = oneapi::mkl::transpose::conjtrans;
@@ -117,7 +118,8 @@ int test(device *dev, oneapi::mkl::layout layout, int64_t group_count) {
transb[i] = oneapi::mkl::transpose::conjtrans;
else
transb[i] = (oneapi::mkl::transpose)tmp;
} else {
}
else {
transa[i] = (oneapi::mkl::transpose)(std::rand() % 2);
transb[i] = (oneapi::mkl::transpose)(std::rand() % 2);
}