cout<<"Transfering "<<bytes/mega_byte<<" MB from HOST to HOST took "<<time<<" seconds. Bandwidth is "<<host_to_host_band_width<<" GB/s."<<endl;
timer.Reset();
for(inti=0;i<cycles;i++)
device_vector=host_vector;
time=timer.getTime();
host_to_device_band_width=bytes/giga_byte/time;
cout<<"Transfering "<<bytes/mega_byte<<" MB from HOST to DEVICE took "<<time<<" seconds. Bandwidth is "<<host_to_device_band_width<<" GB/s."<<endl;
timer.Reset();
for(inti=0;i<cycles;i++)
host_vector2=device_vector;
time=timer.getTime();
device_to_host_band_width=bytes/giga_byte/time;
cout<<"Transfering "<<bytes/mega_byte<<" MB from DEVICE to HOST took "<<time<<" seconds. Bandwidth is "<<device_to_host_band_width<<" GB/s."<<endl;
timer.Reset();
for(inti=0;i<cycles;i++)
device_vector2=device_vector;
time=timer.getTime();
// Since we read and write tha data back we process twice as many bytes.
bytes*=2;
device_to_device_band_width=bytes/giga_byte/time;
tnlTimerRTtimer;
constdoubleoneGB=1024.0*1024.0*1024.0;
cout<<"Transfering "<<bytes/mega_byte<<" MB from DEVICE to DEVICE took "<<time<<" seconds. Bandwidth is "<<device_to_device_band_width<<" GB/s."<<endl;