matlab svd 速度,matlab – CPU和GPU中的SVD速度

我在Matlab R2014a中测试svd,似乎没有CPU与GPU加速.我正在使用GTX 460卡和Core 2 duo E8500.

这是我的代码:

%test SVD

n=10000;

%host

Mh= rand(n,1000);

tic

%[Uh,Sh,Vh]= svd(Mh);

svd(Mh);

toc

%device

Md = gpuArray.rand(n,1000);

tic

%[Ud,Sd,Vd]= svd(Md);

svd(Md);

toc

此外,运行时间与运行不同,但CPU和GPU版本大致相同.为什么没有加速?

这是一些测试

for i=1:10

clear;

m= 10000;

n= 100;

%host

Mh= rand(m,n);

tic

[Uh,Sh,Vh]= svd(Mh);

toc

%device

Md = gpuArray.rand(m,n);

tic

[Ud,Sd,Vd]= svd(Md);

toc

end

>> test_gpu_svd

Elapsed time is 43.124130 seconds.

Elapsed time is 43.842277 seconds.

Elapsed time is 42.993283 seconds.

Elapsed time is 44.293410 seconds.

Elapsed time is 42.924541 seconds.

Elapsed time is 43.730343 seconds.

Elapsed time is 43.125938 seconds.

Elapsed time is 43.645095 seconds.

Elapsed time is 43.492129 seconds.

Elapsed time is 43.459277 seconds.

Elapsed time is 43.327012 seconds.

Elapsed time is 44.040959 seconds.

Elapsed time is 43.242291 seconds.

Elapsed time is 43.390881 seconds.

Elapsed time is 43.275379 seconds.

Elapsed time is 43.408705 seconds.

Elapsed time is 43.320387 seconds.

Elapsed time is 44.232156 seconds.

Elapsed time is 42.984002 seconds.

Elapsed time is 43.702430 seconds.

for i=1:10

clear;

m= 10000;

n= 100;

%host

Mh= rand(m,n,'single');

tic

[Uh,Sh,Vh]= svd(Mh);

toc

%device

Md = gpuArray.rand(m,n,'single');

tic

[Ud,Sd,Vd]= svd(Md);

toc

end

>> test_gpu_svd

Elapsed time is 21.140301 seconds.

Elapsed time is 21.334361 seconds.

Elapsed time is 21.275991 seconds.

Elapsed time is 21.582602 seconds.

Elapsed time is 21.093408 seconds.

Elapsed time is 21.305413 seconds.

Elapsed time is 21.482931 seconds.

Elapsed time is 21.327842 seconds.

Elapsed time is 21.120969 seconds.

Elapsed time is 21.701752 seconds.

Elapsed time is 21.117268 seconds.

Elapsed time is 21.384318 seconds.

Elapsed time is 21.359225 seconds.

Elapsed time is 21.911570 seconds.

Elapsed time is 21.086259 seconds.

Elapsed time is 21.263040 seconds.

Elapsed time is 21.472175 seconds.

Elapsed time is 21.561370 seconds.

Elapsed time is 21.330314 seconds.

Elapsed time is 21.546260 seconds.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值