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

Function getTypeBuildDefinition

src/backend/oneapi/types.hpp:145–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143#if 0
144template<typename... ARGS>
145AF_CONSTEXPR const char *getTypeBuildDefinition() {
146 using arrayfire::common::half;
147 using std::any_of;
148 using std::array;
149 using std::begin;
150 using std::end;
151 using std::is_same;
152 array<bool, sizeof...(ARGS)> is_half = {is_same<ARGS, half>::value...};
153 array<bool, sizeof...(ARGS)> is_double = {is_same<ARGS, double>::value...};
154 array<bool, sizeof...(ARGS)> is_cdouble = {
155 is_same<ARGS, cdouble>::value...};
156
157 bool half_def =
158 any_of(begin(is_half), end(is_half), [](bool val) { return val; });
159 bool double_def =
160 any_of(begin(is_double), end(is_double), [](bool val) { return val; });
161 bool cdouble_def = any_of(begin(is_cdouble), end(is_cdouble),
162 [](bool val) { return val; });
163
164 if (half_def && (double_def || cdouble_def)) {
165 return " -D USE_HALF -D USE_DOUBLE";
166 } else if (half_def) {
167 return " -D USE_HALF";
168 } else if (double_def || cdouble_def) {
169 return " -D USE_DOUBLE";
170 } else {
171 return "";
172 }
173}
174#endif
175
176} // namespace oneapi

Callers

nothing calls this directly

Calls 2

beginFunction · 0.85
endFunction · 0.85

Tested by

no test coverage detected