DPCT1046#

Note

This diagnostic message is no longer generated by SYCLomatic.

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:

1 void foo(cublasHandle_t handle, float alpha, float beta, void *a, void *b,
2          void *c, cudaDataType_t type) {
3   cublasSgemmEx(handle, CUBLAS_OP_C, CUBLAS_OP_C, 2, 2, 2, &alpha, a, type, 2,
4                 b, type, 2, &beta, c, type, 2);
5 }

results in the following migrated SYCL* code:

 1 void foo(dpct::queue_ptr handle, float alpha, float beta, void *a, void *b,
 2          void *c, dpct::library_data_t type) {
 3   /*
 4   DPCT1046:0: The cublasSgemmEx was not migrated because not all values of
 5   parameters could be evaluated in migration. You need to adjust the code.
 6   */
 7   cublasSgemmEx(handle, oneapi::mkl::transpose::conjtrans,
 8                 oneapi::mkl::transpose::conjtrans, 2, 2, 2, &alpha, a, type, 2,
 9                 b, type, 2, &beta, c, type, 2);
10 }

which is rewritten to:

 1 void foo(dpct::queue_ptr handle, float alpha, float beta, void *a, void *b,
 2          void *c, dpct::library_data_t type) {
 3   switch (type) {
 4     case dpct::library_data_t::real_bfloat16: {
 5       oneapi::mkl::blas::column_major::gemm(
 6           *handle, oneapi::mkl::transpose::conjtrans,
 7           oneapi::mkl::transpose::conjtrans, 2, 2, 2, alpha,
 8           (oneapi::mkl::bfloat16 *)a, 2, (oneapi::mkl::bfloat16 *)b, 2, beta,
 9           (oneapi::mkl::bfloat16 *)c, 2);
10       break;
11     }
12     case dpct::library_data_t::real_half: {
13       oneapi::mkl::blas::column_major::gemm(
14           *handle, oneapi::mkl::transpose::conjtrans,
15           oneapi::mkl::transpose::conjtrans, 2, 2, 2, alpha, (sycl::half *)a, 2,
16           (sycl::half *)b, 2, beta, (sycl::half *)c, 2);
17       break;
18     }
19     case dpct::library_data_t::real_float: {
20       oneapi::mkl::blas::column_major::gemm(
21           *handle, oneapi::mkl::transpose::conjtrans,
22           oneapi::mkl::transpose::conjtrans, 2, 2, 2, alpha, (float *)a, 2,
23           (float *)b, 2, beta, (float *)c, 2);
24       break;
25     }
26     default:
27       throw std::runtime_error("the data type is unsupported");
28   }
29 }