I have a problem about data tranfer from CPU to GPU
I copy 496kB it take 0.2156455 milisecond
I copy 768kB it take 0.2149359 milisecond
I copy 1.4MB it take 0.2054923 milisecond
I copy 4.76MB it take 0.2105404 milisecond
why why??? it take the same time. External Image
can anybody tell me what is this problem?
I write main() function on *.cpp file and call this function from *.cu file
this is my code
//start timer copy data tu cpu-gpu
unsigned int timer = 0;
CUT_SAFE_CALL(cutCreateTimer(&timer));
CUT_SAFE_CALL(cutStartTimer(timer));
//copy data from CPU to GPU
unsigned char* zero_gpu;
int Main_size = sizeof(unsigned char)mainzero_colmainzero_row;
cudaMalloc((void**)&zero_gpu,Main_size);
cudaMemcpy(zero_gpu, zero_cpu, Main_size, cudaMemcpyHostToDevice);
// stop and destroy timer
CUT_SAFE_CALL(cutStopTimer(timer));
printf(“copy CPU - GPU time: %f (ms) \n”, cutGetTimerValue(timer));
CUT_SAFE_CALL(cutDeleteTimer(timer));
when I copy back data from GPU to CPU
it very quickly
I copy 496kB it take 0.0090532 milisecond
I copy 768kB it take 0.0165901 milisecond
I copy 1.4MB it take 0.031168 milisecond
I copy 4.76MB it take 0.1980835 milisecond