matrix transpose

#include <cuda_runtime.h> #include <iostream> #include <stdio.h> __global__ void matrix_transpose_kernel ( const float * input, float * output, int rows, int cols) { int i = blockIdx.x * blockDim.x + threadIdx.x; int j = blockIdx.y * blockDim.y + threadIdx.y; printf( "%d" ,i); if (i < rows && j < cols){ output[j * rows + i] = input[i * cols + j]; } } // input, output are device pointers (i.e.…