- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
The attached code crashes on my core I7 machine which runs ubuntu 9.10 64 bits.
Hagai.
The attached code crashes on my core I7 machine which runs ubuntu 9.10 64 bits.
[cpp]#include#include #include #include #include #include #include #include #include using namespace std; #define NUM_ITEMS 1 #define NUM_WEIGHTS 100 #define NUM_OUTPUTS 25 #define NUM_CYCLES 50 void PrintMatrix(double* pMatrix, const size_t nRows, const size_t nCols) { for (size_t i=0; i<< pMatrix[i * nCols + j] << 't'; } cout << endl; } cout << endl; } void PrintLowerTriangularMatrix(double* pMatrix, const size_t nRowCols) { for (size_t i=0; i<=i; ++j) { cout << pMatrix[i * nRowCols + j] << 't'; } cout << endl; } cout << endl; } void CreatePascalMatrix(double* const pMatrix, const int nWidthHeight) { for (int i=0; i<< "P:" << endl; PrintMatrix(P, NUM_WEIGHTS, NUM_OUTPUTS); int nNumOutputs = NUM_OUTPUTS; char chUplo = 'L'; int nInfo; CreatePascalMatrix(S, NUM_OUTPUTS); cout << "S:" << endl; PrintMatrix(S, NUM_OUTPUTS, NUM_OUTPUTS); dpotrf( &chUplo, &nNumOutputs, S, &nNumOutputs, &nInfo); cout << "S Cholesky:" << endl; PrintLowerTriangularMatrix(S, NUM_OUTPUTS); cblas_dtrsm(CblasRowMajor, CblasRight, CblasLower, CblasTrans, CblasNonUnit, NUM_WEIGHTS, NUM_OUTPUTS, 1, S, NUM_OUTPUTS, P, NUM_WEIGHTS); cout << "X:" << endl; PrintMatrix(P, NUM_WEIGHTS, NUM_OUTPUTS); // multiply to check result cblas_dtrmm(CblasRowMajor, CblasRight, CblasLower, CblasTrans, CblasNonUnit, NUM_WEIGHTS, NUM_OUTPUTS, 1, S, NUM_OUTPUTS, P, NUM_WEIGHTS); cout << "P:" << endl; PrintMatrix(P, NUM_WEIGHTS, NUM_OUTPUTS); } int main() { CalculateGain(); return 0; } [/cpp]
Hagai.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hagai,
at the first glancethis code isn't compiled:
- for(size_ti=0;i<
- the same with PrintLowerTriangularMatrix ..
- CalculateGain() ????
How the input Matrixinitialized?
Can you create thefull version of the test(plus the input data ) and attach it to this thread?
--Gennady
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK, so this is another bug in your code editor... I pasted my code into the forum's code editor after compiling it and it changed it to the version you see above. I'll attach it as a file, you can paste from the attached file and see that it happens.
There is no additional data... the input matrix to dtrsm is a cholesky factor of a pascal matrix, initialized by the CreatePascalMatrix function.
Hagai.
There is no additional data... the input matrix to dtrsm is a cholesky factor of a pascal matrix, initialized by the CreatePascalMatrix function.
Hagai.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - hagai_sela
OK, so this is another bug in your code editor... I pasted my code into the forum's code editor after compiling it and it changed it to the version you see above. I'll attach it as a file, you can paste from the attached file and see that it happens.
There is no additional data... the input matrix to dtrsm is a cholesky factor of a pascal matrix, initialized by the CreatePascalMatrix function.
Hagai.
There is no additional data... the input matrix to dtrsm is a cholesky factor of a pascal matrix, initialized by the CreatePascalMatrix function.
Hagai.
allocating the output array by the following
//double P[NUM_WEIGHTS * NUM_OUTPUTS];
double P[NUM_WEIGHTS * NUM_WEIGHTS];
eliminates the problem
--Gennady
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Gennady Fedorov (Intel)
allocating the output array by the following
//double P[NUM_WEIGHTS * NUM_OUTPUTS];
double P[NUM_WEIGHTS * NUM_WEIGHTS];
eliminates the problem
--Gennady
a - I increased the array size to NUM_WEIGHTS * NUM_WEIGHTS, and it still crashes.
b - I am not sure I follow... Are you suggesting this as a workaround or a bug fix?
The equation is XA=B.
A is a NUM_OUTPUTS * NUM_OUTPUTS matrix, B is a NUM_WEIGHTS * NUM_OUTPUTS matrix, therefore X should also be a NUM_WEIGHTS * NUM_OUTPUTS matrix.
Hagai.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page