- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
I'm trying to use the LAPACKE_dtfsm(..) function to give me a result using these two matrices
double a[4] = { 590.96819903509447, 0.0,
0.0, 72662.562467553944 };
double b[8] = { -174621.706135389, -1305297.25336182, -174621.706135394, 1305297.25336182,
1305297.25336182, -2620409798.2378, -1305297.25336182, -2620409798.23788 };
I've used LAPACKE_dtrttf(LAPACK_ROW_MAJOR, 'N', 'U', 2, a, 2, arp) to convert 'a' into a rectangular full format matrix, arp
then called
LAPACKE_dtfsm(LAPACK_ROW_MAJOR,
'N',
'L',
'U',
'T',
'N',
2,
4,
1.0,
arp,
b,
4);
but it doesn't give the correct answer.
Using matrices the full matrix a and b and calling
cblas_dtrsm(CblasRowMajor, CblasLeft, CblasUpper, CblasTrans, CblasNonUnit, 2, 4, 1.0, a, 2, b, 4);
gives me the expected answer.
Could anyone help me get the call to the LAPACKE_dtfsm(..) function correct?
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
Hi Malc,
The results of trsm and tfsm are the same in my test.
Please try the following test code:
------------------------------------------------------
#include <iostream>
#include "mkl.h"
int main()
{
double a[4] = { 590.96819903509447, 0.0, 0.0, 72662.562467553944 };
double b[12] = {-174621.706135389, 1305297.25336182, -1305297.25336182, -2620409798.2378, -174621.706135394, -1305297.25336182, 1305297.25336182, -2620409798.2378};
double b_trsm[12] = {-174621.706135389, 1305297.25336182, -1305297.25336182, -2620409798.2378, -174621.706135394, -1305297.25336182, 1305297.25336182, -2620409798.2378};
double arp[3];
cblas_dtrsm(CblasColMajor, CblasLeft, CblasUpper, CblasTrans, CblasNonUnit, 2, 4, 1.0, a, 2, b_trsm, 2);
for(int i=0; i<8; i++)
std::cout << "b_trsm[" << i << "] = " << b_trsm[i] << std::endl;
std::cout << "Using compact format" << std::endl;
lapack_int info = 1;
info = LAPACKE_dtrttf(LAPACK_COL_MAJOR, 'N', 'U', 2, a, 2, arp);
for(int i=0; i<3; i++)
std::cout << "arp[" << i << "] = " << arp[i] << std::endl;
std::cout << "DTRTTF info = " << info << std::endl;
info = 1;
info = LAPACKE_dtfsm(LAPACK_COL_MAJOR, 'N', 'L', 'U', 'N', 'N', 2, 4, 1.0, arp, b, 2);
std::cout << "DTFSM info = " << info << std::endl;
for(int i=0; i<8; i++)
std::cout << "b[" << i << "] = " << b[i] << std::endl;
return 0;
}
------------------------------------------------------
The input has been transposed to be consistent with the original row-major layout.
Thanks,
Fengrui
Ссылка скопирована
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
Hello, it looks that there is a product issue with dtfsm when using the row-major layout, while the column-major layout gives the same results as dtrsm. I will escalate this issue to the product team. At the same time, could you please try the column-major layout?
Thanks,
Fengrui
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
Hi Fengrui
Thanks for looking into this for me. I've tried using column major layout and while it calculates all the correct values they don't come back in the same order as the cblas_dtrsm(...) function call.
For the 8 values in matrix b
dtrsm order [0, 1, 2, 3, 4, 5, 6, 7]
dtfsm order [0, 6, 2, 4, 3, 5, 1, 7]
1 and 6 and 3 and 4 have been swapped around. Did the values come back in the same order for you?
Thanks again
Malc
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
Hi Malc,
The results of trsm and tfsm are the same in my test.
Please try the following test code:
------------------------------------------------------
#include <iostream>
#include "mkl.h"
int main()
{
double a[4] = { 590.96819903509447, 0.0, 0.0, 72662.562467553944 };
double b[12] = {-174621.706135389, 1305297.25336182, -1305297.25336182, -2620409798.2378, -174621.706135394, -1305297.25336182, 1305297.25336182, -2620409798.2378};
double b_trsm[12] = {-174621.706135389, 1305297.25336182, -1305297.25336182, -2620409798.2378, -174621.706135394, -1305297.25336182, 1305297.25336182, -2620409798.2378};
double arp[3];
cblas_dtrsm(CblasColMajor, CblasLeft, CblasUpper, CblasTrans, CblasNonUnit, 2, 4, 1.0, a, 2, b_trsm, 2);
for(int i=0; i<8; i++)
std::cout << "b_trsm[" << i << "] = " << b_trsm[i] << std::endl;
std::cout << "Using compact format" << std::endl;
lapack_int info = 1;
info = LAPACKE_dtrttf(LAPACK_COL_MAJOR, 'N', 'U', 2, a, 2, arp);
for(int i=0; i<3; i++)
std::cout << "arp[" << i << "] = " << arp[i] << std::endl;
std::cout << "DTRTTF info = " << info << std::endl;
info = 1;
info = LAPACKE_dtfsm(LAPACK_COL_MAJOR, 'N', 'L', 'U', 'N', 'N', 2, 4, 1.0, arp, b, 2);
std::cout << "DTFSM info = " << info << std::endl;
for(int i=0; i<8; i++)
std::cout << "b[" << i << "] = " << b[i] << std::endl;
return 0;
}
------------------------------------------------------
The input has been transposed to be consistent with the original row-major layout.
Thanks,
Fengrui
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
Hi Fengrui
I can confirm that the results match with the transposed input.
Thanks again,
Malc
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
Hi Malc,
The wrong output of dtfsm with row-major layout seems to be related to the LAPACK Reference implementation, as it can be reproduced with both Netlib LAPACK version 3.11 and Netlib LAPACK 3.12 (https://www.netlib.org/lapack/).
We highly recommend to file a separate issue against Reference Netlib LAPACK by using the link https://github.com/Reference-LAPACK/lapack/issues. We can file an issue on your behalf but we need a permission to use the reproducer (the data you provided).
Thanks,
Fengrui
- Отметить как новое
- Закладка
- Подписаться
- Отключить
- Подписка на RSS-канал
- Выделить
- Печать
- Сообщить о недопустимом содержимом
Hi Malc,
As a follow-up to this issue. We have fixed the wrong result of dtfsm with row-major layout in oneMKL 2025.0. Did you get a chance to try this new version?
Thanks,
Fengrui
- Подписка на RSS-канал
- Отметить тему как новую
- Отметить тему как прочитанную
- Выполнить отслеживание данной Тема для текущего пользователя
- Закладка
- Подписаться
- Страница в формате печати