Here's my code:
tic;
reset(gpuDevice(1)); clear all;
format long;
R_i_gpu=gpuArray(6);
dL_gpu=gpuArray(1.e-5);
n_gpu=R_i_gpu/dL_gpu;
theta_i_gpu=dL_gpu/R_i_gpu;
R_final_gpu=gpuArray(2);
dR_gpu=R_final_gpu-R_i_gpu;
d_theta_gpu=gpuArray(3*pi/2);
dR_d_theta_gpu=dR_gpu/d_theta_gpu;
Ri_gpu=R_i_gpu;
thetai_gpu=theta_i_gpu;
n=gather(n_gpu);
itime=toc
tic;
for i=1:n-1;
Ri_gpu=Ri_gpu+(dR_d_theta_gpu*thetai_gpu);
thetai_gpu=dL_gpu/Ri_gpu;
R_gpu(i)=Ri_gpu;
theta_gpu(i)=thetai_gpu;
end
rtime=toc
theta_gpu=[theta_i_gpu theta_gpu]';
theta_sum_gpu=sum(theta_gpu);
theta_sum_deg_gpu=theta_sum_gpu*360/(2*pi);
I'm running this on a 3930K with a nVidia GTX 660 Superclocked and I noticed that as my dL_gpu goes from 1.e-4 to 1.e-5, the effective computational rate decreased. So, I started using GPU-Z to monitor the memory usage and the GPU load and the GPU memory controller load and found that both the GPU load and GPU memory controller load increases as time goes on and now I am trying to figure out why it is doing that?
Should it be that if you're solving a 1-D integration of a Newton's approximate-like solution that for each step/iteration, the time required is the same?
I'm trying to understand how MATLAB builds arrays for A(i)=B. Does it rebuild the entire array at each iteration or does it just add the latest entry to the bottom of the list?
And if that is the case, then why is the memory controller load going up (also as a function of time)?
Any assistance that can try and help me understand what's going on behind the scenes would be greatly appreciated! Thank you!