Hi Albert, > I thought that a good way to get good performance is to formulate all > the calculations somehow vectorized but I'm not sure if I have chosen > the best way because the code performs badly. The matrices are big, > about 10k \times 10k in size.
This is correct, provided that the vectorization is not carried out via adding a lot of operations by zeros. > My code is below. Maybe you can give me some suggestions about how to > do that fast. Basically, in `mat_column_mult`, I want to multiply a > certain column of a matrix. Currently, I multiply with 0, maybe that > is a special case where I can do even faster. In > `layerActivity_addBiasTerm`, I want to add a left scalar column to a > matrix. The issue in the code are the matrix-matrix multiplications, even though you only want to scale columns. For such cases you can use the new column() function to extract a column from a matrix and scale that. In-place operations are supposed to work, so you can directly write viennacl::column(A, 7) *= factor; Have a look here: https://github.com/viennacl/viennacl-dev/blob/master/tests/src/matrix_vector.cpp#L235 on how to use it. As with most functionality in ViennaCL, it's basically the same as in Boost.uBlas. For this to compile, however, you need to use the developer version from GitHub (https://github.com/viennacl/viennacl-dev) or wait a few more days until the 1.5.0 release is finally out. :-) Best regards, Karli ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk _______________________________________________ ViennaCL-devel mailing list ViennaCL-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/viennacl-devel