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

Function resize

src/backend/cpu/resize.cpp:21–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19
20template<typename T>
21Array<T> resize(const Array<T> &in, const dim_t odim0, const dim_t odim1,
22 const af_interp_type method) {
23 af::dim4 idims = in.dims();
24 af::dim4 odims(odim0, odim1, idims[2], idims[3]);
25 // Create output placeholder
26 Array<T> out = createValueArray(odims, static_cast<T>(0));
27
28 switch (method) {
29 case AF_INTERP_NEAREST:
30 getQueue().enqueue(kernel::resize<T, AF_INTERP_NEAREST>, out, in);
31 break;
32 case AF_INTERP_BILINEAR:
33 getQueue().enqueue(kernel::resize<T, AF_INTERP_BILINEAR>, out, in);
34 break;
35 case AF_INTERP_LOWER:
36 getQueue().enqueue(kernel::resize<T, AF_INTERP_LOWER>, out, in);
37 break;
38 default: break;
39 }
40 return out;
41}
42
43#define INSTANTIATE(T) \
44 template Array<T> resize<T>(const Array<T> &in, const dim_t odim0, \

Callers

nothing calls this directly

Calls 4

createValueArrayFunction · 0.70
getQueueFunction · 0.50
dimsMethod · 0.45
enqueueMethod · 0.45

Tested by

no test coverage detected