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

Function isFreqDomain

src/api/c/convolve.cpp:99–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97}
98
99bool isFreqDomain(const int rank, const af_array &signal, const af_array filter,
100 af_conv_domain domain) {
101 if (domain == AF_CONV_FREQ) { return true; }
102 if (domain != AF_CONV_AUTO) { return false; }
103
104 const ArrayInfo &sInfo = getInfo(signal);
105 const ArrayInfo &fInfo = getInfo(filter);
106
107 const dim4 &sdims = sInfo.dims();
108 dim4 fdims = fInfo.dims();
109
110 if (identifyBatchKind(rank, sdims, fdims) == AF_BATCH_DIFF) { return true; }
111
112 int kbatch = 1;
113 for (int i = 3; i >= rank; i--) { kbatch *= fdims[i]; }
114
115 if (kbatch >= 10) { return true; }
116 if (rank == 1) {
117 if (fdims[0] > 128) { return true; }
118 }
119 if (rank == 2) {
120 // maximum supported size in 2D domain
121 if (fdims[0] > 17 || fdims[1] > 17) { return true; }
122
123 // Maximum supported non square size
124 if (fdims[0] != fdims[1] && fdims[0] > 5) { return true; }
125 }
126 if (rank == 3) {
127 if (fdims[0] > 5 || fdims[1] > 5 || fdims[2] > 5) { return true; }
128 }
129 return false;
130}
131
132af_err convolve(af_array *out, const af_array signal, const af_array filter,
133 const af_conv_mode mode, const int rank) {

Callers 3

af_convolve1Function · 0.85
af_convolve2Function · 0.85
af_convolve3Function · 0.85

Calls 2

identifyBatchKindFunction · 0.70
dimsMethod · 0.45

Tested by

no test coverage detected