【发布时间】:2017-09-07 12:59:40
【问题描述】:
我怎么知道,犰狳正在我的 ARM 上使用 openblas?
-
背景
我正在用犰狳写一个程序,我安装了openblas,并使用交叉编译器来编译它。我希望使用犰狳和 openblas 的程序比只使用犰狳更快。但他们同时运行。 那么,在我的 armv7 板上,我怎么知道犰狳正在使用 openblas?
-
环境
PC:ubuntu16.04 交叉编译器:arm-linux-g++ 博拉德:ARM v7
-
编译器命令:
- 仅适用于犰狳:
arm-linux-g++ -mtune=cortex-a7 -std=c++11 -I/home/sgks/SGKS6802_LinuxSDK/sdk_build/system/01_software/armadillo-8.100.0_install/include -L/opt/sgks/rootfs/usr/lib -L/home/sgks/SGKS6802_LinuxSDK/sdk_build/system/01_software/armadillo-8.100.0_install/lib -o ./cmake-build-debug/armadillo_test ./main.cpp -larmadillo -O3
2. with armadillo and openblas:
arm-linux-g++ -mtune=cortex-a7 -std=c++11 -I/home/sgks/SGKS6802_LinuxSDK/sdk_build/system/01_software/armadillo-8.100.0_install/include -I/home/sgks/SGKS6802_LinuxSDK/sdk_build/system/01_software/OpenBLAS-0.2.20-install-arm/include -L/home/sgks/SGKS6802_LinuxSDK/sdk_build/system/01_software/armadillo-8.100.0_install/lib -L/home/sgks/SGKS6802_LinuxSDK/sdk_build/system/01_software/OpenBLAS-0.2.20-install-arm/lib -o ./cmake-build-debug/armadillo_test ./main.cpp -DARMA_DONT_USE_WRAPPER -lopenblas -O3
-
测试代码: `
包括
包括
使用命名空间 arma; 主函数() { clock_t 开始,停止; 双杜; fmat weight_layer1(2801, 2642,fill::randu); fmat weigth_layer2(2643, 2645, fill::randu); fmat weigth_layer3(2646, 2527, fill::randu); fmat weigth_layer4(2528, 607, fill::randu);
fmat input(1, 2801, fill::randu); fmat layer1_output(1,2643); fmat layer2_output(1,2646); fmat layer3_output(1,2528); fmat layer4_output(1,607); //************************* layer1 ************************* start = clock(); layer1_output(0,span(0,2641)) = input * weigth_layer1; layer1_output(0,2642) = 1.0; //bias layer1_output.elem(find(layer1_output < 0 )) -= layer1_output.elem(find(layer1_output < 0 )); //Relu cout << "layer1: " << layer1_output.n_cols << endl; //************************* layer2 ************************* layer2_output(0,span(0,2644)) = layer1_output * weigth_layer2; layer2_output(0,2645) = 1.0; //bias cout << "layer2: " << layer2_output.n_cols << endl; layer2_output.elem(find(layer2_output < 0 )) -= layer2_output.elem(find(layer2_output < 0 )); //Relu //************************* layer3 ************************* layer3_output(0,span(0,2526)) = layer2_output * weigth_layer3; layer3_output(0,2527) = 1.0; cout << "layer3: " << layer3_output.n_cols << endl; layer3_output.elem(find(layer3_output < 0 )) -= layer3_output.elem(find(layer3_output < 0 )); //Relu //************************* layer4 ************************* layer4_output = layer3_output * weigth_layer4; cout << "layer4: " << layer4_output.n_cols << endl; stop = clock(); dur = stop - start; printf("time : %f\n", dur / CLOCKS_PER_SEC); return 0;}
`
PS:代码格式不对,请问stackoverflow不支持markdown吗?
【问题讨论】: