LocalFilters.jl icon indicating copy to clipboard operation
LocalFilters.jl copied to clipboard

[Optimization] Specialize `localmap` and `localreduce`

Open emmt opened this issue 10 months ago • 3 comments

localmap has some overheads due to the local buffer that must be allocated and filled. These overheads can be avoided in some specific cases:

  • Specialize localmap so that localmap(mean,A,B) is the same as localmean(A,B); except that B can provides weight in localmean.
  • Specialize localmap so that localmap(minimum,A,B) and localmap(maximum,A,B) is the same as erode(A,B) and dilate(A,B).
  • Similarly localmap(sum,A,B) can be (if B is a simple box) optimized as localreduce(+,T,A,B) with suitable element type T.

emmt avatar Mar 12 '25 11:03 emmt

Have you compared performance to other libraries? Specifically vs. Intel IPP?

RoyiAvital avatar Mar 12 '25 16:03 RoyiAvital

No not yet. I do not have this commercial library.

emmt avatar Mar 12 '25 20:03 emmt

It is available for free either as standalone or part of oneAPI:

https://www.intel.com/content/www/us/en/developer/tools/oneapi/ipp.html

RoyiAvital avatar Mar 13 '25 05:03 RoyiAvital