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

Function identifyBatchKind

src/api/c/convolve.cpp:77–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77AF_BATCH_KIND identifyBatchKind(const int rank, const dim4 &sDims,
78 const dim4 &fDims) {
79 dim_t sn = sDims.ndims();
80 dim_t fn = fDims.ndims();
81
82 if (sn == rank && fn == rank) { return AF_BATCH_NONE; }
83 if (sn == rank && (fn > rank && fn <= AF_MAX_DIMS)) { return AF_BATCH_RHS; }
84 if ((sn > rank && sn <= AF_MAX_DIMS) && fn == rank) { return AF_BATCH_LHS; }
85 if ((sn > rank && sn <= AF_MAX_DIMS) && (fn > rank && fn <= AF_MAX_DIMS)) {
86 bool doesDimensionsMatch = true;
87 bool isInterleaved = true;
88 for (dim_t i = rank; i < AF_MAX_DIMS; i++) {
89 doesDimensionsMatch &= (sDims[i] == fDims[i]);
90 isInterleaved &=
91 (sDims[i] == 1 || fDims[i] == 1 || sDims[i] == fDims[i]);
92 }
93 if (doesDimensionsMatch) { return AF_BATCH_SAME; }
94 return (isInterleaved ? AF_BATCH_DIFF : AF_BATCH_UNSUPPORTED);
95 }
96 return AF_BATCH_UNSUPPORTED;
97}
98
99bool isFreqDomain(const int rank, const af_array &signal, const af_array filter,
100 af_conv_domain domain) {

Callers 2

isFreqDomainFunction · 0.70
convolveFunction · 0.70

Calls 1

ndimsMethod · 0.45

Tested by

no test coverage detected