Matlab [gpu加速测试]

t = zeros(1,100);
A = rand(2000,2000);B = rand(2000,2000);C = rand(2000,2000);
tic;
for i=1:100    
    D=A+B;E=A.*D;F=B./(E+eps);
end;
t=toc;
t1 = gpuArray(zeros(1,100));
A1 = gpuArray(rand(2000,2000));
B1 = gpuArray(rand(2000,2000));
C1 = gpuArray(rand(2000,2000));
tic;
for i=1:100
    D1=A1+B1;E1=A1.*D1;F1=B1./(E1+eps);   
end
t1=toc;
t/t1

 

你可能感兴趣的:(计算机基础)