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

Function genCompileOptions

src/backend/opencl/kernel/approx.hpp:32–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30
31template<typename Ty, typename Tp>
32auto genCompileOptions(const int order, const int xdim, const int ydim = -1) {
33 constexpr bool isComplex =
34 static_cast<af_dtype>(dtype_traits<Ty>::af_type) == c32 ||
35 static_cast<af_dtype>(dtype_traits<Ty>::af_type) == c64;
36
37 ToNumStr<Ty> toNumStr;
38
39 std::vector<std::string> compileOpts = {
40 DefineKeyValue(Ty, dtype_traits<Ty>::getName()),
41 DefineKeyValue(Tp, dtype_traits<Tp>::getName()),
42 DefineKeyValue(InterpInTy, dtype_traits<Ty>::getName()),
43 DefineKeyValue(InterpValTy, dtype_traits<Ty>::getName()),
44 DefineKeyValue(InterpPosTy, dtype_traits<Tp>::getName()),
45 DefineKeyValue(ZERO, toNumStr(scalar<Ty>(0))),
46 DefineKeyValue(XDIM, xdim),
47 DefineKeyValue(INTERP_ORDER, order),
48 DefineKeyValue(IS_CPLX, (isComplex ? 1 : 0)),
49 };
50 if (ydim != -1) { compileOpts.emplace_back(DefineKeyValue(YDIM, ydim)); }
51 compileOpts.emplace_back(getTypeBuildDefinition<Ty>());
52 addInterpEnumOptions(compileOpts);
53
54 return compileOpts;
55}
56
57template<typename Ty, typename Tp>
58void approx1(Param yo, const Param yi, const Param xo, const int xdim,

Callers

nothing calls this directly

Calls 2

getNameFunction · 0.85
addInterpEnumOptionsFunction · 0.85

Tested by

no test coverage detected