From 536fd2ba7a304d9cf9779b93382ecfa3201ea4e3 Mon Sep 17 00:00:00 2001
From: Dominik Zobel <zobel@dkrz.de>
Date: Mon, 1 Jul 2024 09:07:36 +0200
Subject: [PATCH] Add memory hierarchies exercise

---
 _quarto.yml                      |  2 +-
 exercises/memory-hierarchies.qmd | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)
 create mode 100644 exercises/memory-hierarchies.qmd

diff --git a/_quarto.yml b/_quarto.yml
index f861f10..dd0f9f5 100644
--- a/_quarto.yml
+++ b/_quarto.yml
@@ -57,7 +57,7 @@ website:
           - "exercises/parallelism/parallelism.qmd"
           - "exercises/hardware/hardware.qmd"
           - "exercises/file-and-data-systems.qmd"
-          # - "exercises/memory_hierarchies.qmd"
+          - "exercises/memory-hierarchies.qmd"
           # - "exercises/student_talks.qmd"
 
 format:
diff --git a/exercises/memory-hierarchies.qmd b/exercises/memory-hierarchies.qmd
new file mode 100644
index 0000000..d31771f
--- /dev/null
+++ b/exercises/memory-hierarchies.qmd
@@ -0,0 +1,11 @@
+---
+title: "Memory Hierarchies"
+---
+
+Review the memory mountain hands-on and look into the source code:
+In `main()` the function `run()` is called for each combination of `size` and `stride`
+which in turn calls `fcyc2()` and `fcyc2_full()`.
+
+What happens there to ensure that only the desired cache effects for the test function `f` are measured?
+Describe the mechanism and why it is necessary for accurate measurements in a short paragraph.
+Refer to the code and what you learned in the lecture about it.
-- 
GitLab