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

Function af_transpose_inplace

src/api/c/transpose.cpp:92–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92af_err af_transpose_inplace(af_array in, const bool conjugate) {
93 try {
94 const ArrayInfo& info = getInfo(in);
95 af_dtype type = info.getType();
96 af::dim4 dims = info.dims();
97
98 // InPlace only works on square matrices
99 DIM_ASSERT(0, dims[0] == dims[1]);
100
101 // If singleton element
102 if (dims[0] == 1) { return AF_SUCCESS; }
103
104 switch (type) {
105 case f32: transpose_inplace<float>(in, conjugate); break;
106 case c32: transpose_inplace<cfloat>(in, conjugate); break;
107 case f64: transpose_inplace<double>(in, conjugate); break;
108 case c64: transpose_inplace<cdouble>(in, conjugate); break;
109 case b8: transpose_inplace<char>(in, conjugate); break;
110 case s32: transpose_inplace<int>(in, conjugate); break;
111 case u32: transpose_inplace<uint>(in, conjugate); break;
112 case s8: transpose_inplace<schar>(in, conjugate); break;
113 case u8: transpose_inplace<uchar>(in, conjugate); break;
114 case s64: transpose_inplace<intl>(in, conjugate); break;
115 case u64: transpose_inplace<uintl>(in, conjugate); break;
116 case s16: transpose_inplace<short>(in, conjugate); break;
117 case u16: transpose_inplace<ushort>(in, conjugate); break;
118 case f16: transpose_inplace<half>(in, conjugate); break;
119 default: TYPE_ERROR(1, type);
120 }
121 }
122 CATCHALL;
123
124 return AF_SUCCESS;
125}

Callers 2

transposeip_testFunction · 0.50
transposeInPlaceFunction · 0.50

Calls 2

getTypeMethod · 0.45
dimsMethod · 0.45

Tested by

no test coverage detected