In my use case (pass input image(s) from the CPU as a xf::Mats, run a single custom image processing step as a SDX accelerator function, return results as an xf::Mat image and continue processing on the CPU), I experience significant performance improvements when accessing the result xf::Mat from the CPU if I allocate the memory with sds_alloc instead.
Currently, I do this by manually setting the height, width and data (and allocatedFlag) of the Mat objects instead of simply calling init. But I consider this a rather ugly hack - would it be an option to add a bool parameter cacheable to the allocating functions/constructors of xf::Mat that determines whether the memory is allocated with sds_alloc or sds_alloc_non_cacheable?
The memory of
xf::Mat
is currently always allocated withsds_alloc_non_cacheable
, e.g.: https://github.com/Xilinx/xfopencv/blob/701cf6d88b4980d7e4e73aa7d84fa58bc60f2aa3/include/common/xf_structs.h#L469In my use case (pass input image(s) from the CPU as a
xf::Mat
s, run a single custom image processing step as a SDX accelerator function, return results as anxf::Mat
image and continue processing on the CPU), I experience significant performance improvements when accessing the resultxf::Mat
from the CPU if I allocate the memory withsds_alloc
instead.Currently, I do this by manually setting the
height
,width
anddata
(andallocatedFlag
) of the Mat objects instead of simply callinginit
. But I consider this a rather ugly hack - would it be an option to add abool
parametercacheable
to the allocating functions/constructors ofxf::Mat
that determines whether the memory is allocated withsds_alloc
orsds_alloc_non_cacheable
?