MCPcopy Create free account
hub / github.com/ComputationalRobotics/XM-code / symBatchedKernel

Function symBatchedKernel

XM/include/Dense/transpose.h:42–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40
41template <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
53template <typename T>
54void symBatched(T* out, const T* in, size_s mat_size, size_s batch_size) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected