To familiarize myself with Nsight Compute, I am incrementally writing a matrix transpose kernel, first step being a “copy kernel” to establish some global memory throughput numbers.
I do verify that the kernel output is valid, but Nsight Compute seems to be missing the write back from L2 to Global memory.
__global__ void copyKernel(float* __restrict__ dataIn, float* __restrict__ dataOut, uint32_t xDimension, uint32_t yDimension) {
__shared__ float cache[TILE_DIMENSION_X][TILE_DIMENSION_Y];
#pragma unroll
for(uint32_t yIndex{ (blockIdx.y * blockDim.y) + threadIdx.y }; yIndex < yDimension; yIndex += (gridDim.y * blockDim.y))
for(uint32_t xIndex{ (blockIdx.x * blockDim.x) + threadIdx.x }; xIndex < xDimension; xIndex += (gridDim.x * blockDim.x)) {
const uint32_t index{ xIndex + (xDimension * yIndex) };
cache[threadIdx.y][threadIdx.x] = dataIn[index];
dataOut[index] = cache[threadIdx.y][threadIdx.x];
}
}

