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

Function DiagKernel

XM/include/Dense/trace.h:11–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9// diag of a square matrix
10template <typename T>
11__global__ void DiagKernel(T* mat, T* diag, size_s N) {
12 // mat is the input square matrix, and diag is the vector output
13 size_l idx = threadIdx.x + blockIdx.x * blockDim.x;
14 if(idx < N){
15 diag[idx] = mat[idx*N+idx];
16 }
17
18}
19
20template <typename T>
21__global__ void traceKernel(T* mat, T* result, size_s N) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected