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

Function calcParamSizes

src/backend/oneapi/kernel/fftconvolve_common.hpp:29–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27
28template<typename T, typename convT>
29void calcParamSizes(Param<T>& sig_tmp, Param<T>& filter_tmp,
30 Param<convT>& packed, Param<T>& sig, Param<T>& filter,
31 const int rank, AF_BATCH_KIND kind) {
32 sig_tmp.info.dims[0] = filter_tmp.info.dims[0] = packed.info.dims[0];
33 sig_tmp.info.strides[0] = filter_tmp.info.strides[0] = 1;
34
35 for (int k = 1; k < 4; k++) {
36 if (k < rank) {
37 sig_tmp.info.dims[k] = packed.info.dims[k];
38 filter_tmp.info.dims[k] = packed.info.dims[k];
39 } else {
40 sig_tmp.info.dims[k] = sig.info.dims[k];
41 filter_tmp.info.dims[k] = filter.info.dims[k];
42 }
43
44 sig_tmp.info.strides[k] =
45 sig_tmp.info.strides[k - 1] * sig_tmp.info.dims[k - 1];
46 filter_tmp.info.strides[k] =
47 filter_tmp.info.strides[k - 1] * filter_tmp.info.dims[k - 1];
48 }
49
50 // NOTE: The OpenCL implementation on which this oneAPI port is
51 // based treated the incoming `packed` buffer as a string of real
52 // scalars instead of complex numbers. OpenCL accomplished this
53 // with the hack depicted in the trailing two lines. This note
54 // remains here in an explanation of SYCL buffer reinterpret's in
55 // fftconvolve kernel invocations.
56
57 // sig_tmp.data = packed.data;
58 // filter_tmp.data = packed.data;
59
60 // Calculate memory offsets for packed signal and filter
61 if (kind == AF_BATCH_RHS) {
62 filter_tmp.info.offset = 0;
63 sig_tmp.info.offset =
64 filter_tmp.info.strides[3] * filter_tmp.info.dims[3] * 2;
65 } else {
66 sig_tmp.info.offset = 0;
67 filter_tmp.info.offset =
68 sig_tmp.info.strides[3] * sig_tmp.info.dims[3] * 2;
69 }
70}
71
72} // namespace kernel
73} // namespace oneapi

Callers 4

reorderOutputHelperFunction · 0.70
padDataHelperFunction · 0.70
packDataHelperFunction · 0.70
complexMultiplyHelperFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected