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

Function af_stdev_v2

src/api/c/stdev.cpp:140–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140af_err af_stdev_v2(af_array* out, const af_array in, const af_var_bias bias,
141 const dim_t dim) {
142 try {
143 ARG_ASSERT(2, (dim >= 0 && dim <= 3));
144
145 af_array output = 0;
146 const ArrayInfo& info = getInfo(in);
147 af_dtype type = info.getType();
148 switch (type) {
149 case f64: output = stdev<double, double>(in, dim, bias); break;
150 case f32: output = stdev<float, float>(in, dim, bias); break;
151 case s32: output = stdev<int, float>(in, dim, bias); break;
152 case u32: output = stdev<uint, float>(in, dim, bias); break;
153 case s16: output = stdev<short, float>(in, dim, bias); break;
154 case u16: output = stdev<ushort, float>(in, dim, bias); break;
155 case s64: output = stdev<intl, double>(in, dim, bias); break;
156 case u64: output = stdev<uintl, double>(in, dim, bias); break;
157 case s8: output = stdev<schar, float>(in, dim, bias); break;
158 case u8: output = stdev<uchar, float>(in, dim, bias); break;
159 case b8: output = stdev<char, float>(in, dim, bias); break;
160 // TODO(umar): FIXME: sqrt(complex) is not present in cuda/opencl
161 // backend case c32: output = stdev<cfloat, cfloat>(in, dim);
162 // break; case c64: output = stdev<cdouble,cdouble>(in, dim); break;
163 default: TYPE_ERROR(1, type);
164 }
165 std::swap(*out, output);
166 }
167 CATCHALL;
168 return AF_SUCCESS;
169}

Callers 2

af_stdevFunction · 0.70
stdevFunction · 0.50

Calls 2

swapFunction · 0.85
getTypeMethod · 0.45

Tested by

no test coverage detected