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

Function transform

src/backend/cpu/transform.cpp:21–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19
20template<typename T>
21void transform(Array<T> &out, const Array<T> &in, const Array<float> &tf,
22 const af_interp_type method, const bool inverse,
23 const bool perspective) {
24 out.eval();
25 in.eval();
26
27 // TODO: Temporary Fix, must fix handling subarrays upstream
28 // tf has to be linear, although offset is allowed
29 const Array<float> tf_Lin = tf.isLinear() ? tf : copyArray(tf);
30 tf.eval();
31
32 switch (method) {
33 case AF_INTERP_NEAREST:
34 case AF_INTERP_LOWER:
35 getQueue().enqueue(kernel::transform<T, 1>, out, in, tf_Lin,
36 inverse, perspective, method);
37 break;
38 case AF_INTERP_BILINEAR:
39 case AF_INTERP_BILINEAR_COSINE:
40 getQueue().enqueue(kernel::transform<T, 2>, out, in, tf_Lin,
41 inverse, perspective, method);
42 break;
43 case AF_INTERP_BICUBIC:
44 case AF_INTERP_BICUBIC_SPLINE:
45 getQueue().enqueue(kernel::transform<T, 3>, out, in, tf_Lin,
46 inverse, perspective, method);
47 break;
48 default: AF_ERROR("Unsupported interpolation type", AF_ERR_ARG); break;
49 }
50}
51
52#define INSTANTIATE(T) \
53 template void transform(Array<T> &out, const Array<T> &in, \

Callers 1

joinFunction · 0.70

Calls 5

copyArrayFunction · 0.70
getQueueFunction · 0.50
evalMethod · 0.45
isLinearMethod · 0.45
enqueueMethod · 0.45

Tested by

no test coverage detected