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

Function cpu_norm1

test/norm.cpp:70–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70double cpu_norm1(af::array &value) {
71 double norm1;
72 af::dim4 dims = value.dims();
73 if (value.type() == f16) {
74 vector<half_float::half> values(value.elements());
75 value.host(values.data());
76 norm1 = cpu_norm1_impl<half_float::half>(dims, values);
77 } else if (value.type() == c32 || value.type() == c64) {
78 vector<complex<double> > values(value.elements());
79 value.as(c64).host(values.data());
80 norm1 = cpu_norm1_impl<complex<double> >(dims, values);
81 } else {
82 vector<double> values(value.elements());
83 value.as(f64).host(values.data());
84 norm1 = cpu_norm1_impl<double>(dims, values);
85 }
86 return norm1;
87}
88
89double cpu_norm_pq(af::array &value, double p, double q) {
90 double norm2;

Callers 1

TEST_PFunction · 0.85

Calls 5

typeMethod · 0.80
hostMethod · 0.80
asMethod · 0.80
dimsMethod · 0.45
elementsMethod · 0.45

Tested by

no test coverage detected