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

Function af_bitnot

src/api/c/unary.cpp:587–616  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

585}
586
587af_err af_bitnot(af_array *out, const af_array in) {
588 try {
589 const ArrayInfo &iinfo = getInfo(in);
590 const af_dtype type = iinfo.getType();
591
592 dim4 odims = iinfo.dims();
593
594 if (odims.ndims() == 0) {
595 return af_create_handle(out, 0, nullptr, type);
596 }
597
598 af_array res;
599 switch (type) {
600 case s32: res = bitOpNot<int>(in); break;
601 case u32: res = bitOpNot<uint>(in); break;
602 case s8: res = bitOpNot<schar>(in); break;
603 case u8: res = bitOpNot<uchar>(in); break;
604 case b8: res = bitOpNot<char>(in); break;
605 case s64: res = bitOpNot<intl>(in); break;
606 case u64: res = bitOpNot<uintl>(in); break;
607 case s16: res = bitOpNot<short>(in); break;
608 case u16: res = bitOpNot<ushort>(in); break;
609 default: TYPE_ERROR(0, type);
610 }
611
612 std::swap(*out, res);
613 }
614 CATCHALL;
615 return AF_SUCCESS;
616}
617
618af_err af_arg(af_array *out, const af_array in) {
619 try {

Callers 1

operator~Method · 0.85

Calls 5

swapFunction · 0.85
af_create_handleFunction · 0.70
getTypeMethod · 0.45
dimsMethod · 0.45
ndimsMethod · 0.45

Tested by

no test coverage detected