| 40 | |
| 41 | template <typename T> |
| 42 | __global__ void symBatchedKernel(T* out, const T* in, size_s mat_size, size_s batch_size) { |
| 43 | size_l x = blockIdx.x * blockDim.x + threadIdx.x; |
| 44 | size_l y = blockIdx.y * blockDim.y + threadIdx.y; |
| 45 | |
| 46 | if (x < mat_size && y < mat_size * batch_size) { |
| 47 | size_s bid = y / mat_size; |
| 48 | size_s y_elem = y % mat_size; |
| 49 | out[bid * mat_size * mat_size + y_elem * mat_size + x] = (in[bid * mat_size * mat_size + x * mat_size + y_elem] + in[bid * mat_size * mat_size + y_elem * mat_size + x])*0.5; |
| 50 | } |
| 51 | } |
| 52 | // transpose a matrix |
| 53 | template <typename T> |
| 54 | void symBatched(T* out, const T* in, size_s mat_size, size_s batch_size) { |
nothing calls this directly
no outgoing calls
no test coverage detected