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

Function af_cplx2

src/api/c/complex.cpp:40–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40af_err af_cplx2(af_array *out, const af_array lhs, const af_array rhs,
41 bool batchMode) {
42 try {
43 af_dtype type = implicit(lhs, rhs);
44
45 if (type == c32 || type == c64) {
46 AF_ERROR("Inputs to cplx2 can not be of complex type", AF_ERR_ARG);
47 }
48
49 if (type != f64) { type = f32; }
50 dim4 odims =
51 getOutDims(getInfo(lhs).dims(), getInfo(rhs).dims(), batchMode);
52 if (odims.ndims() == 0) {
53 return af_create_handle(out, 0, nullptr, type);
54 }
55
56 af_array res;
57 switch (type) {
58 case f32: res = cplx<cfloat, float>(lhs, rhs, odims); break;
59 case f64: res = cplx<cdouble, double>(lhs, rhs, odims); break;
60 default: TYPE_ERROR(0, type);
61 }
62
63 std::swap(*out, res);
64 }
65 CATCHALL;
66 return AF_SUCCESS;
67}
68
69af_err af_cplx(af_array *out, const af_array in) {
70 try {

Callers 1

af_powFunction · 0.85

Calls 6

implicitFunction · 0.85
getOutDimsFunction · 0.85
swapFunction · 0.85
af_create_handleFunction · 0.70
dimsMethod · 0.45
ndimsMethod · 0.45

Tested by

no test coverage detected