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

Function convolve2

src/api/c/convolve.cpp:51–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49
50template<typename T, typename accT>
51inline af_array convolve2(const af_array &s, const af_array &c_f,
52 const af_array &r_f, const bool expand) {
53 const Array<accT> colFilter = castArray<accT>(c_f);
54 const Array<accT> rowFilter = castArray<accT>(r_f);
55 const Array<accT> signal = castArray<accT>(s);
56
57 if (colFilter.isScalar() && rowFilter.isScalar()) {
58 Array<accT> colArray =
59 arrayfire::common::tile(colFilter, signal.dims());
60 Array<accT> rowArray =
61 arrayfire::common::tile(rowFilter, signal.dims());
62
63 Array<accT> filter =
64 arithOp<accT, af_mul_t>(colArray, rowArray, signal.dims());
65
66 return getHandle(cast<T, accT>(
67 arithOp<accT, af_mul_t>(signal, filter, signal.dims())));
68 }
69
70 ARG_ASSERT(2, colFilter.isVector());
71 ARG_ASSERT(3, rowFilter.isVector());
72
73 return getHandle(
74 convolve2<T, accT>(getArray<T>(s), colFilter, rowFilter, expand));
75}
76
77AF_BATCH_KIND identifyBatchKind(const int rank, const dim4 &sDims,
78 const dim4 &fDims) {

Callers 8

TESTFunction · 0.50
TESTFunction · 0.50
TESTFunction · 0.50
gforFunction · 0.50
convolve.cppFile · 0.50
TEST_PFunction · 0.50
TYPED_TESTFunction · 0.50
fullFunction · 0.50

Calls 5

isVectorMethod · 0.80
tileFunction · 0.70
getHandleFunction · 0.70
isScalarMethod · 0.45
dimsMethod · 0.45

Tested by

no test coverage detected