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

Function cpu_norm_inf_impl

test/norm.cpp:109–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107
108template<typename T>
109double cpu_norm_inf_impl(af::dim4 &dims, std::vector<T> &value) {
110 int M = dims[0];
111 int N = dims[1];
112
113 double norm_inf = std::numeric_limits<double>::lowest();
114 for (int m = 0; m < M; m++) {
115 T *rowM = value.data() + m;
116 double sum = 0;
117 for (int n = 0; n < N; n++) { sum += abs(rowM[n * M]); }
118 norm_inf = std::max(norm_inf, sum);
119 }
120 return norm_inf;
121}
122
123double cpu_norm_inf(af::array &value) {
124 double norm_inf;

Callers

nothing calls this directly

Calls 2

absFunction · 0.70
maxFunction · 0.70

Tested by

no test coverage detected