cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

rexiaoyu
Journeyman III

About the scratch buffer size

In CAL scratch buffer sample, the scratch buffer size is computed in the following way:

 

 

 

The NUM_PS_THREADS is the amount of the threads? But actually there are (Info.Width * Info.Heigth) threads in total.

And why tHeight is 1024? 

/* Calculate the dimensions of the scratch buffer */ static const CALuint R600NumQuadPipeElements = 16; static const CALuint NUM_PS_THREADS = Info.Width; static const CALuint numQdPipes = 4; static const CALuint numScratchRegsNeeded = 2; static const CALuint RoundUpBufSize = 4096; CALuint scratchRingSizeInBytes = numScratchRegsNeeded * 4 * R600NumQuadPipeElements * numQdPipes * NUM_PS_THREADS * sizeof(CALuint); scratchRingSizeInBytes = (scratchRingSizeInBytes + (RoundUpBufSize-1)) & ~(RoundUpBufSize-1); tWidth = scratchRingSizeInBytes / 1024; tHeight = 1024; flag = CAL_RESALLOC_GLOBAL_BUFFER; mComponents = Info.SrcComponents;

0 Likes
0 Replies