| 6 | |
| 7 | template <typename T> |
| 8 | __global__ void transposeKernel(T* out, const T* in, int width, int height) { |
| 9 | size_l x = blockIdx.x * blockDim.x + threadIdx.x; |
| 10 | size_l y = blockIdx.y * blockDim.y + threadIdx.y; |
| 11 | |
| 12 | if (x < width && y < height) { |
| 13 | out[x * height + y] = in[y * width + x]; |
| 14 | } |
| 15 | } |
| 16 | // transpose a matrix |
| 17 | template <typename T> |
| 18 | void transpose(T* out, const T* in, size_s width, size_s height) { |
nothing calls this directly
no outgoing calls
no test coverage detected