changeset 1546:8b9cdadb845a bugfix/sbp_operators/stencil_return_type

Add some comments
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 12 Apr 2024 12:26:30 +0200
parents 7cfa729e256d
children a0296d9a609d
files Notes.md src/SbpOperators/stencil.jl
diffstat 2 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/Notes.md	Fri Apr 12 10:11:52 2024 +0200
+++ b/Notes.md	Fri Apr 12 12:26:30 2024 +0200
@@ -348,3 +348,11 @@
 * This would impact how tensor grid works.
 * To make things homogenous maybe these index collections should be used for the more simple grids too.
 * The function `to_indices` from Base could be useful to implement for `IndexCollection`
+
+
+## Stencil application pipeline
+We should make sure that `@inbounds` and `Base.@propagate_inbounds` are
+applied correctly throughout the stack. When testing the performance of
+stencil application on the bugfix/sbp_operators/stencil_return_type branch
+there seemed to be some strange results where such errors could be the
+culprit.
--- a/src/SbpOperators/stencil.jl	Fri Apr 12 10:11:52 2024 +0200
+++ b/src/SbpOperators/stencil.jl	Fri Apr 12 12:26:30 2024 +0200
@@ -80,6 +80,18 @@
     end
 end
 
+# There are many options for the implementation of `apply_stencil` and
+# `apply_stencil_backwards`. Some alternatives were tried on the branch
+# bugfix/sbp_operators/stencil_return_type and can be found at the following
+# revision:
+#
+# * 237b980ffb91 (baseline)
+# * a72bab15228e (mapreduce)
+# * ffd735354d54 (multiplication)
+# * b5abd5191f2c (promote_op)
+# * 8d56846185fc (return_type)
+#
+
 function left_pad(s::Stencil, N)
     weights = LazyTensors.left_pad_tuple(s.weights, zero(eltype(s)), N)
     range = (first(s.range) - (N - length(s.weights))):last(s.range)