Skip to content

Add blocking algo for transposed view - #813

Open
sdebionne wants to merge 3 commits into
boostorg:developfrom
sdebionne:add-transposed-algo
Open

sdebionne wants to merge 3 commits into
boostorg:developfrom
sdebionne:add-transposed-algo

Conversation

@sdebionne

Copy link
Copy Markdown
Contributor

Description

This is a revival of PR #525. It adds a number of benchmark for reference, mostly on geometry transformation .

This MR mainly introduces a specialization of algorithms for transposed image view. The implementation uses a blocking algorithm to improve cache efficiency.

Performance of copy_pixels and transform_pixels on transposed view vary from x2 faster for smaller image to x3 faster on larger one.

Run on (64 X 3200 MHz CPU s)
CPU Caches:
L1 Data 32 KiB (x32)
L1 Instruction 32 KiB (x32)
L2 Unified 1024 KiB (x32)
L3 Unified 22528 KiB (x2)

current implementation

---------------------------------------------------------
Benchmark               Time             CPU   Iterations
---------------------------------------------------------
transpose/256       28564 ns        28564 ns        24407
transpose/512      132876 ns       132873 ns         5287
transpose/1024     548770 ns       548773 ns         1294
transpose/2048    2255201 ns      2255131 ns          302
transpose/4096   10757579 ns     10757075 ns           64
transpose/8192   63558779 ns     63556336 ns           11

blocked implementation

---------------------------------------------------------
Benchmark               Time             CPU   Iterations
---------------------------------------------------------
transpose/256       14612 ns        14612 ns        48072
transpose/512       57761 ns        57758 ns        11879
transpose/1024     446445 ns       446419 ns         1597
transpose/2048    3551008 ns      3550669 ns          195
transpose/4096   25210960 ns     25206203 ns           25
transpose/8192  175161964 ns    175150467 ns            4

References

See the docs in benchmark/README.md to build and run the benchmarks with CMake and pixi.

See #525 for the previous effort on the topic (benchmarks only).

Tasklist

  • Add test case(s)
  • Ensure all CI builds pass
  • Review and approve

@sdebionne sdebionne added cat/enhancement Improvements, but not fixes addressing identified bugs cat/performance Performance issues, speed-ups and benchmarks labels Oct 20, 2026
@sdebionne sdebionne added this to the Boost 1.94 milestone Oct 20, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat/enhancement Improvements, but not fixes addressing identified bugs cat/performance Performance issues, speed-ups and benchmarks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant