This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Matrices for an OpenCL-like float3 struct

Tags: None
(comma "," separated)
vladk
Registered Member
Posts
1
Karma
0
Hi all,

I'm trying to optimize a Matrix * Vector multiplication. What I have originally looks something like:
Code: Select all
Eigen::SparseMatrix<float, Eigen::ColMajor> originalMatrix;
Eigen::SparseVector<float> vec[3];
Eigen::SparseMatrix<float> result[3];
for( int i = 0; i < 3; i++ )
{
  result[i] = originalMatrix * vec[i];
}


What I'm trying to do is something like:
Code: Select all
Eigen::SparseMatrix<float, Eigen::ColMajor> originalMatrix;
Eigen::SparseVector<float3> vec;
Eigen::SparseMatrix<float3> result;

result = originalMatrix * vec;


where float3 is a struct containing 3 floats, and with all the relevant operators overridden. My reasoning is that it should use SSE / AVX instructions when multiplying 3 floats by 1 float. If the code already uses SSE instructions, I'd like to see the performance difference when using this approach.

I'm currently getting errors about conj_helper not being defined (in gebp_kernel::operator() in Core\products\GeneralBlockPanelKernel.h). I'd really appreciate it if anyone could explain the high-level architecture in Core\arch\SSE\Complex.h and Core\util\BlasUtil.h (and whatever else needs to be modified).

Off topic - I have a small optimization for SparseMatrix::setFromTriplets() if anyone is interested (no custom instructions, just code re-arranging).
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
I'm confused because your code is showing sparse matrices while the reported error concerns dense matrix product...


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]