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

Function cpu_norm_pq

test/norm.cpp:89–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89double cpu_norm_pq(af::array &value, double p, double q) {
90 double norm2;
91 af::dim4 dims = value.dims();
92 if (value.type() == f16) {
93 vector<half_float::half> values(value.elements());
94 value.host(values.data());
95 norm2 = cpu_norm_pq_impl<half_float::half>(dims, values, p, q);
96 } else if (value.type() == c32 || value.type() == c64) {
97 vector<complex<double> > values(value.elements());
98 value.as(c64).host(values.data());
99 norm2 = cpu_norm_pq_impl<complex<double> >(dims, values, p, q);
100 } else {
101 vector<double> values(value.elements());
102 value.as(f64).host(values.data());
103 norm2 = cpu_norm_pq_impl<double>(dims, values, p, q);
104 }
105 return norm2;
106}
107
108template<typename T>
109double cpu_norm_inf_impl(af::dim4 &dims, std::vector<T> &value) {

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