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

Function af_lower

src/api/c/data.cpp:357–385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355}
356
357af_err af_lower(af_array *out, const af_array in, bool is_unit_diag) {
358 try {
359 const ArrayInfo &info = getInfo(in);
360 af_dtype type = info.getType();
361
362 if (info.ndims() == 0) { return af_retain_array(out, in); }
363
364 af_array res = nullptr;
365 switch (type) {
366 case f32: res = triangle<float>(in, false, is_unit_diag); break;
367 case f64: res = triangle<double>(in, false, is_unit_diag); break;
368 case c32: res = triangle<cfloat>(in, false, is_unit_diag); break;
369 case c64: res = triangle<cdouble>(in, false, is_unit_diag); break;
370 case s32: res = triangle<int>(in, false, is_unit_diag); break;
371 case u32: res = triangle<uint>(in, false, is_unit_diag); break;
372 case s64: res = triangle<intl>(in, false, is_unit_diag); break;
373 case u64: res = triangle<uintl>(in, false, is_unit_diag); break;
374 case s16: res = triangle<short>(in, false, is_unit_diag); break;
375 case u16: res = triangle<ushort>(in, false, is_unit_diag); break;
376 case s8: res = triangle<schar>(in, false, is_unit_diag); break;
377 case u8: res = triangle<uchar>(in, false, is_unit_diag); break;
378 case b8: res = triangle<char>(in, false, is_unit_diag); break;
379 case f16: res = triangle<half>(in, false, is_unit_diag); break;
380 }
381 std::swap(*out, res);
382 }
383 CATCHALL
384 return AF_SUCCESS;
385}
386
387af_err af_upper(af_array *out, const af_array in, bool is_unit_diag) {
388 try {

Callers 1

lowerFunction · 0.50

Calls 4

swapFunction · 0.85
af_retain_arrayFunction · 0.70
getTypeMethod · 0.45
ndimsMethod · 0.45

Tested by

no test coverage detected