MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / toLinear

Function toLinear

extensions/include/cuMat/src/Iterator.h:51–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49 {}
50
51 __host__ __device__
52 static Index toLinear(const Index3& coords, const Index3& stride)
53 {
54 Index l = 0;
55 //for (int i = 0; i < 3; ++i) l += coords[i] * stride[i];
56 //manual loop unrolling
57 l += coords.get<0>() * stride.get<0>();
58 l += coords.get<1>() * stride.get<1>();
59 l += coords.get<2>() * stride.get<2>();
60 return l;
61 }
62
63 __host__ __device__
64 static Index3 fromLinear(Index linear, const Index3& dims, const Index3& stride)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected