1
Im bei dieser Implementierung von DCT suchen CUDA: http://www.cse.nd.edu/courses/cse60881/www/source_code/dct8x8/dct8x8_kernel1.cu Der Teil in Frage hier ist:Texturkoordinaten in Cuda
__shared__ float CurBlockLocal1[BLOCK_SIZE2];
__global__ void CUDAkernel1DCT(float *Dst, int ImgWidth, int OffsetXBlocks, int OffsetYBlocks)
{
// Block index
const int bx = blockIdx.x + OffsetXBlocks;
const int by = blockIdx.y + OffsetYBlocks;
// Thread index (current coefficient)
const int tx = threadIdx.x;
const int ty = threadIdx.y;
// Texture coordinates
const float tex_x = (float)((bx << BLOCK_SIZE_LOG2) + tx) + 0.5f;
const float tex_y = (float)((by << BLOCK_SIZE_LOG2) + ty) + 0.5f;
//copy current image pixel to the first block
CurBlockLocal1[ (ty << BLOCK_SIZE_LOG2) + tx ] = tex2D(TexSrc, tex_x, tex_y);
//synchronize threads to make sure the block is copied
__syncthreads();
wo Blockgröße 8 ist so block_size_log2 3. ist
Warum das ist Texturkoordinaten definiert wie es ist? Warum müssen wir Texturkoordinaten verwenden? Was ist das "< <" in Cuda?