Visible to Intel only — GUID: GUID-C15A4969-D20A-4FDD-A888-2F0C3189996D
Visible to Intel only — GUID: GUID-C15A4969-D20A-4FDD-A888-2F0C3189996D
DPCT1046
Message
The <original API name> was not migrated because <reason>. You need to adjust the code.
Detailed Help
Not all data type combinations are supported by mkl::blas::gemm().
This may be due to one of the following reasons:
Not all values of parameters could be evaluated in migration.
The combination of matrix data type and scalar type is unsupported.
Use a supported data type to rewrite the code.
Suggestions to Fix
Please refer to the gemm topic of the Intel® oneAPI Math Kernel Library (oneMKL) - Data Parallel C++ Developer Reference for supported data types to fix the code manually.
For example, this original CUDA* code:
void foo(cublasHandle_t handle, float alpha, float beta, void *a, void *b,
void *c, cudaDataType_t type) {
cublasSgemmEx(handle, CUBLAS_OP_C, CUBLAS_OP_C, 2, 2, 2, &alpha, a, type, 2,
b, type, 2, &beta, c, type, 2);
}
results in the following migrated SYCL* code:
void foo(dpct::queue_ptr handle, float alpha, float beta, void *a, void *b,
void *c, dpct::library_data_t type) {
/*
DPCT1046:0: The cublasSgemmEx was not migrated because not all values of
parameters could be evaluated in migration. You need to adjust the code.
*/
cublasSgemmEx(handle, oneapi::mkl::transpose::conjtrans,
oneapi::mkl::transpose::conjtrans, 2, 2, 2, &alpha, a, type, 2,
b, type, 2, &beta, c, type, 2);
}
which is rewritten to:
void foo(dpct::queue_ptr handle, float alpha, float beta, void *a, void *b,
void *c, dpct::library_data_t type) {
switch (type) {
case dpct::library_data_t::real_bfloat16: {
oneapi::mkl::blas::column_major::gemm(
*handle, oneapi::mkl::transpose::conjtrans,
oneapi::mkl::transpose::conjtrans, 2, 2, 2, alpha,
(oneapi::mkl::bfloat16 *)a, 2, (oneapi::mkl::bfloat16 *)b, 2, beta,
(oneapi::mkl::bfloat16 *)c, 2);
break;
}
case dpct::library_data_t::real_half: {
oneapi::mkl::blas::column_major::gemm(
*handle, oneapi::mkl::transpose::conjtrans,
oneapi::mkl::transpose::conjtrans, 2, 2, 2, alpha, (sycl::half *)a, 2,
(sycl::half *)b, 2, beta, (sycl::half *)c, 2);
break;
}
case dpct::library_data_t::real_float: {
oneapi::mkl::blas::column_major::gemm(
*handle, oneapi::mkl::transpose::conjtrans,
oneapi::mkl::transpose::conjtrans, 2, 2, 2, alpha, (float *)a, 2,
(float *)b, 2, beta, (float *)c, 2);
break;
}
default:
throw std::runtime_error("the data type is unsupported");
}
}