1

アルマジロでBLASライブラリの代わりにOpenBLASを使用することで達成されたスピードアップを知っている人はいますか?

ここに私の結果があります:アルマジロでベクトルを行列に掛けようとしています

    #include <iostream>   
    #include<armadillo>
    using namespace std;
    using namespace arma;
int main(int argc, char** argv) {

int num_examples = 100000;
vec randperm(num_examples, fill::zeros);
for(uword i=0;i<num_examples;i++)
    randperm(i) = i;

vec randnum = shuffle(randperm);
randperm.reset();

sp_mat X = sprandu<sp_mat>(num_examples,127,0.8);
mat W(3,127,fill::randn);
wall_clock timer;
double t;

timer.tic();
uword pred_class = (X.row(randnum(10))*W.t()).index_max();
 t= timer.toc();
cout<<"Elapsed time is:"<<t<<endl;
}

-lopenblas:Elapsed time is:0.0374926 を使用した結果は次のとおりです。

-armadillo のみを使用した結果は次のとおりです。経過時間は:0.084193

私のマシン: 4 つの物理コア (ハイパースレッディングが有効、8 コア) で実行されている Ubuntu 14.04

4

0 に答える 0