2012年11月8日星期四

Look into Code 2

   kgpu / kgpu / gpuops.cu

For setting up the buffer size of KGPU. Why not use dynamic programing to watch the video card that if the GPU is using shared memory with individual memory.

watch (RAM)
test(GPU memory)
lock (shared memory)
set max_kgpu_buf_size=(shared memory + gpu memory)/2
build first area(GPU memory)-->a1
build second area(share memory)--> a2
...
if (a1 not filled && flag!=1)
   while (flag==2)
   wait;
   flag=0;
  do assignment;
else 
{
    flag=1
    reload current work;
    assign to a2;
    flag=2;
    move less active work to shared memory.
   
} 

This idea is to also use the assigned shared memory for any computation for later on. Also, as memory inside GPU is faster accessed by GPU itself, so put the memory of GPU at the first place, after it fills up, starts to use shared memory while do freeing GPU memory

没有评论:

发表评论