| 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) |
nothing calls this directly
no outgoing calls
no test coverage detected