| 23 | |
| 24 | template <typename T> |
| 25 | __global__ void symKernel(T* out, const T* in, int mat_size) { |
| 26 | size_l x = blockIdx.x * blockDim.x + threadIdx.x; |
| 27 | size_l y = blockIdx.y * blockDim.y + threadIdx.y; |
| 28 | |
| 29 | if (x < mat_size && y < mat_size) { |
| 30 | out[x * mat_size + y] = (in[x * mat_size + y] + in[y * mat_size + x])*0.5; |
| 31 | } |
| 32 | } |
| 33 | // transpose a matrix |
| 34 | template <typename T> |
| 35 | void sym(T* out, const T* in, size_s mat_size) { |
nothing calls this directly
no outgoing calls
no test coverage detected