MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / getFNSD

Function getFNSD

src/api/cpp/common.hpp:27–38  ·  view source on GitHub ↗

Get the first non-zero dimension

Source from the content-addressed store, hash-verified

25
26/// Get the first non-zero dimension
27static inline dim_t getFNSD(const int dim, af::dim4 dims) {
28 if (dim >= 0) return dim;
29
30 dim_t fNSD = 0;
31 for (dim_t i = 0; i < 4; ++i) {
32 if (dims[i] > 1) {
33 fNSD = i;
34 break;
35 }
36 }
37 return fNSD;
38}
39
40namespace {
41// casts from one type to another. Needed for af_half conversions specialization

Callers 15

stdevFunction · 0.85
medianFunction · 0.85
lookupFunction · 0.85
meanFunction · 0.85
varFunction · 0.85
sumFunction · 0.85
sumByKeyFunction · 0.85
productFunction · 0.85
productByKeyFunction · 0.85
minFunction · 0.85
minByKeyFunction · 0.85
maxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected