Visible to Intel only — GUID: GUID-C7127468-C2DE-480C-93EC-1ED4E6521A60
Visible to Intel only — GUID: GUID-C7127468-C2DE-480C-93EC-1ED4E6521A60
DPCT1016
Message
The <API name> was not migrated, because parameter(s) <parameter name a> and/or <parameter name b> could not be evaluated, or because <parameter name a> is not equal to <parameter name b>. Rewrite this code manually.
Detailed Help
The cublasSetMatrix can be migrated by Intel® DPC++ Compatibility Tool only when lda and ldb have the same constant value. In cases where the migration did not occur, rewrite the code manually.
If the values of lda and ldb are the same, you can use the following code:
dpct::dpct_memcpy((void*)(B), (void*)(A), lda*cols*elemSize, dpct::host_to_device); // For cublasGetMatrix, use dpct::device_to_host
Otherwise, you can copy the columns of the matrix or elements of the vector one by one.
The equivalent of cublasSetMatrix(rows, cols, elemSize, A, lda, B, ldb) is:
auto A_backup = A; auto B_backup = B; A = A - lda; B = B - ldb; for (int c = 0; c < cols; ++c) { A = A + lda; B = B + ldb; dpct::dpct_memcpy( (void *)(B), (void *)(A), rows * elemSize, dpct::host_to_device); // For cublasGetMatrix, use dpct::device_to_host } A = A_backup; B = B_backup;
Intel® DPC++ Compatibility Tool can migrate the cublasSetVector only when incx and incy have the same constant value. In cases where the migration does not occur, rewrite the code manually.
If the values of incx and incy are the same, you can use the following code:
dpct::dpct_memcpy((void*)(B), (void*)(A), n*incx*elemSize, dpct::host_to_device); // For cublasGetVector, use dpct::device_to_host
Otherwise, you can copy the elements of the vector one by one:
To replace cublasGetVector(n, elemSize, x, incx, y, incy), use the following snippet:
auto x_backup = x; auto y_backup = y; x = x - incx; y = y - incy; for (int c = 0; c < n; ++c) { x = x + incx; y = y + incy; dpct::dpct_memcpy( (void *)(y), (void *)(x), elemSize, dpct::device_to_host); // for cublasSetVector, use dpct::host_to_device } x = x_backup; y = y_backup;
Suggestions to Fix
Review the logic and adjust it.