From df77d23dc743cb690e0d651eeb38cc06aef52ceb Mon Sep 17 00:00:00 2001 From: Hariprasad KANNAN Date: Wed, 21 Oct 2026 09:54:02 +0200 Subject: [PATCH] Remove previous module summaries at the beginning of modules 2 and 3 Signed-off-by: Hariprasad KANNAN --- .../KokkosTutorial_02_ViewsAndSpaces.tex | 43 ------- .../KokkosTutorial_03_MDRangeMoreViews.tex | 120 ------------------ 2 files changed, 163 deletions(-) diff --git a/Content/Presentations/modularized/KokkosTutorial_02_ViewsAndSpaces.tex b/Content/Presentations/modularized/KokkosTutorial_02_ViewsAndSpaces.tex index 383ac546..3d2d94a2 100644 --- a/Content/Presentations/modularized/KokkosTutorial_02_ViewsAndSpaces.tex +++ b/Content/Presentations/modularized/KokkosTutorial_02_ViewsAndSpaces.tex @@ -75,49 +75,6 @@ \end{itemize} \end{frame} -\begin{frame}{Module 1: Summary} - \textbf{Kokkos Ecosystem:} - \begin{itemize} - \item C\texttt{++} Performance Portability Programming Model. - \item The Kokkos Ecosystem provides capabilities needed for serious code development. - \item Kokkos is supported by multiple National Laboratories with a sizeable dedicated team. - \end{itemize} - - \textbf{Building Kokkos} - \begin{itemize} - \item{Kokkos's primary build system is CMAKE.} - \item{Kokkos options are transitively passed on, including many necessary compiler options.} - \item{The Spack package manager does support Kokkos.} - \item{For applications with few if any dependencies, building Kokkos as part of your code is an option with CMake and GNU Makefiles.} - \end{itemize} -\end{frame} - -\begin{frame}[fragile]{Module 1: Summary} - \textbf{Data Parallelism:} - \begin{itemize} - \item Simple things stay simple! - \item You use \textbf{parallel patterns} and \textbf{execution policies} to execute \textbf{computational bodies} - \item Simple parallel loops use the \texttt{parallel\_for} pattern: -\begin{code}[linebackgroundcolor={\btLstHL<1->{3}{bodyColor}},frame=single] - @patternparallel_for@pattern("Label",@policyN@policy, [=] (int64_t i) { - /* loop body */ - }); -\end{code} -\item Reductions combine contributions from loop iterations -\begin{code}[linebackgroundcolor={\btLstHL<1->{3}{bodyColor}},frame=single] -int result; -@patternparallel_reduce@pattern("Label",@policyN@policy, [=] (int64_t i, int& lres) { - /* loop body */ - lres += /* something */ - },result); -\end{code} - -\end{itemize} - - \textbf{Recording:} \url{https://bit.ly/kokkos-lecture-series-1} - -\end{frame} - \begin{frame}{Module 2} \begin{block}{Kokkos View} What are Views? How to create them? Why should you use it? diff --git a/Content/Presentations/modularized/KokkosTutorial_03_MDRangeMoreViews.tex b/Content/Presentations/modularized/KokkosTutorial_03_MDRangeMoreViews.tex index 819001c0..27bb927a 100644 --- a/Content/Presentations/modularized/KokkosTutorial_03_MDRangeMoreViews.tex +++ b/Content/Presentations/modularized/KokkosTutorial_03_MDRangeMoreViews.tex @@ -75,126 +75,6 @@ \end{itemize} \end{frame} -\begin{frame}[fragile]{Module 1: Summary} - \textbf{Kokkos Ecosystem} - - \textbf{Building Kokkos} - - \textbf{Data Parallelism:} - - \begin{itemize} - \item Simple parallel loops use the \texttt{parallel\_for} pattern: -\begin{code}[linebackgroundcolor={\btLstHL<1->{3}{bodyColor}},frame=single] -@patternparallel_for@pattern("Label",@policyN@policy, [=] (int64_t i) { - /* loop body */ -}); -\end{code} -\item Reductions combine contributions from loop iterations -\begin{code}[linebackgroundcolor={\btLstHL<1->{3}{bodyColor}},frame=single] -int result; -@patternparallel_reduce@pattern("Label",@policyN@policy, [=] (int64_t i, int& lres) { - /* loop body */ - lres += /* something */ - },result); -\end{code} - -\end{itemize} - - \textbf{Recording:} \url{https://bit.ly/kokkos-lecture-series-1} - -\end{frame} - - - -\begin{frame}[fragile]{Module 2: Summary} - \textbf{Kokkos View} - \begin{itemize} - \item Multi Dimensional Array. - \item Compile and Runtime Dimensions. - \item Reference counted like a \texttt{std::shared\_ptr} to an array. - \end{itemize} -\begin{code}[keywords={View,int}] - Kokkos::View a("A", N); - a(3,2) = 7; -\end{code} - - \textbf{Execution Spaces} - \begin{itemize} - \item{Parallel operations execute in a specified \textbf{Execution Space}} - \item{Can be controlled via template argument to \textbf{Execution Policy}} - \item{If no Execution Space is provided use \texttt{DefaultExecutionSpace}} - \end{itemize} -\begin{code}[keywords={parallel_for,Cuda,RangePolicy}] -// Equivalent: -parallel_for("L", N, functor); -parallel_for("L", - RangePolicy(0, N), functor); -\end{code} -\end{frame} - -\begin{frame}[fragile]{Module 2: Summary} - \textbf{Memory Spaces} - \begin{itemize} - \item Kokkos Views store data in \textbf{Memory Spaces}. - \item Provided as template parameter. - \item If no Memory Space is given, use \texttt{Kokkos::DefaultExecutionSpace::memory\_space}. - \item \texttt{deep\_copy} is used to transfer data: no hidden memory copies by Kokkos. - \end{itemize} -\begin{code}[keywords={View,int,CudaSpace,create_mirror_view}] - View a("A", M); - // View in host memory to load from file - auto h_a = create_mirror_view(a); - load_from_file(h_a); - // Copy - deep_copy(a,h_a); -\end{code} - -\end{frame} - -\begin{frame}[fragile]{Module 2: Summary} - \textbf{Layouts} - \begin{itemize} - \item Kokkos Views use an index mapping to memory determined by a \textbf{Layout}. - \item Provided as template parameter. - \item If no \textbf{Layout} is given, derived from the execution space associated with the memory space. - \item Defaults are good if you parallelize over left most index! - \end{itemize} - -\begin{code}[keywords={View,int,CudaSpace}] - View a("A", N, M); - View b("B", N, M); - - parallel_for("Fill", N, KOKKOS_LAMBDA(int i) { - for(int j = 0; j < M; j++) { - a(i,j) = i * 1000 + j; // coalesced - b(i,j) = i * 1000 + j; // cached - } - }); -\end{code} - -\end{frame} - -\begin{frame}[fragile]{Module 2: Summary} - \textbf{Advanced Reductions} - \begin{itemize} - \item \texttt{parallel\_reduce} defaults to summation - \item Kokkos reducers can be used to reduce over arbitrary operations - \item Reductions over multiple values are supported - \item Only reductions into scalar arguments are guaranteed to be synchronous - \item Support for custom reductions - \end{itemize} - -\begin{code}[keywords={View,int,CudaSpace}] - parallel_reduce("Join", n, - KOKKOS_LAMBDA(int i, double& a, int& b) { - int idx = foo(); - if(idx > b) b = idx; - a += bar(); - }, result, Kokkos::Max{my_max}); -\end{code} - -\end{frame} - \begin{frame}{Module 3} \begin{block}{MultiDimensional Loops} How to parallelize tightly nested loops using the MDRangePolicy?