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

Store 1D SE differentiation matrix

Open sriharshakandala opened this issue 1 year ago • 10 comments

Store 1D SE differentiation matrix to avoid recomputation in spectral element kernels

  • [x] Code follows the style guidelines OR N/A.
  • [x] Unit tests are included OR N/A.
  • [x] Code is exercised in an integration test OR N/A.
  • [x] Documentation has been added/updated OR N/A.

sriharshakandala avatar Aug 21 '23 22:08 sriharshakandala

bors try

sriharshakandala avatar Aug 21 '23 22:08 sriharshakandala

try

Build failed:

bors[bot] avatar Aug 21 '23 23:08 bors[bot]

bors r-

sriharshakandala avatar Aug 21 '23 23:08 sriharshakandala

bors try

sriharshakandala avatar Aug 21 '23 23:08 sriharshakandala

try

Build failed:

bors[bot] avatar Aug 22 '23 01:08 bors[bot]

bors try

sriharshakandala avatar Aug 22 '23 03:08 sriharshakandala

try

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here. For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

bors[bot] avatar Aug 22 '23 05:08 bors[bot]

Does this make any difference? Since it's an SArray, it should just get baked into the kernel.

simonbyrne avatar Aug 22 '23 16:08 simonbyrne

Does this make any difference? Since it's an SArray, it should just get baked into the kernel.

This will 1) reduce op count for each thread in the kernel, 2) eliminate storage of full differentiation matrix on each thread (insteading of just loading one entry per thread onto shmem) 3) potentially reduce register usage for busy kernels!

sriharshakandala avatar Aug 22 '23 16:08 sriharshakandala

I don't quite see how this would help with that: basically the only difference is that this would pass it through as a kernel parameter, rather than as a compile-time constant. Do you have a benchmark?

simonbyrne avatar Aug 22 '23 18:08 simonbyrne