From 5bf7ba718359bfb1db59188cdee22d95e0e13a9a Mon Sep 17 00:00:00 2001 From: Arturo Vargas Date: Mon, 12 Aug 2024 16:18:56 -0700 Subject: [PATCH 1/4] update readme cmake requirement --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d894911..b67b333 100644 --- a/README.md +++ b/README.md @@ -11,13 +11,13 @@ tutorial and then moving on to the Intermediate tutorial. If you are running on an LC machine and would like to build locally, be sure to do the following to build and run the tutorials: ``` -module load cmake/3.20.2 +module load cmake/3.23.1 module load gcc/8.3.1 module load cuda/11.2.0 cmake -DENABLE_CUDA=On -DENABLE_OPENMP=Off -DCMAKE_CUDA_ARCHITECTURES=70 -DCMAKE_CUDA_COMPILER=/usr/tce/packages/cuda/cuda-11.2.0/bin/nvcc -DCUDA_TOOLKIT_ROOT_DIR=/usr/tce/packages/cuda/cuda-11.2.0 -DBLT_CXX_STD=c++14 -DCMAKE_BUILD_TYPE=Release -DRAJA_ENABLE_EXERCISES=On -DRAJA_ENABLE_OPENMP=Off -DCMAKE_CUDA_FLAGS=--extended-lambda -DCUDA_ARCH=sm_70 ../ ``` -(Note: you need a cmake version greater than 3.19 and you need a more +(Note: you need a cmake version greater or equal than 3.23.1 and you need a more recent gcc version which can handle c++14. For example, on the Lassen LC machine a cmake command like `cmake -DBLT_CXX_STD=c++14 -DCMAKE_CUDA_ARCHITECTURES=70 -DENABLE_CUDA=On -DCMAKE_CUDA_FLAGS="--expt-extended-lambda" ../` after loading appropriate cmake and gcc modules will work well.) # License From fe0473286a9f0f252f8af53185ea3ccc88cf7be6 Mon Sep 17 00:00:00 2001 From: Arturo Vargas Date: Sun, 1 Sep 2024 13:47:22 -0700 Subject: [PATCH 2/4] fix error caught in live tutorial --- .../solution/03_umpire_allocator_solution.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Intro_Tutorial/lessons/03_umpire_allocator/solution/03_umpire_allocator_solution.cpp b/Intro_Tutorial/lessons/03_umpire_allocator/solution/03_umpire_allocator_solution.cpp index d512d5d..c760c81 100644 --- a/Intro_Tutorial/lessons/03_umpire_allocator/solution/03_umpire_allocator_solution.cpp +++ b/Intro_Tutorial/lessons/03_umpire_allocator/solution/03_umpire_allocator_solution.cpp @@ -10,12 +10,12 @@ int main() // TODO: allocate an array of 100 doubles using the HOST allocator auto& rm = umpire::ResourceManager::getInstance(); auto allocator = rm.getAllocator("HOST"); - void* memory = allocator.allocate(100*sizeof(double)); + void* data = allocator.allocate(100*sizeof(double)); std::cout << "Address of data: " << data << std::endl; // TODO: deallocate the array - allocator.deallocate(memory); + allocator.deallocate(data); return 0; } From 4a6ca9fdaf8b4b59b73dd1c521f811256d809365 Mon Sep 17 00:00:00 2001 From: Arturo Vargas Date: Sun, 1 Sep 2024 13:51:57 -0700 Subject: [PATCH 3/4] clean up pass --- .../solution/03_umpire_allocator_solution.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Intro_Tutorial/lessons/03_umpire_allocator/solution/03_umpire_allocator_solution.cpp b/Intro_Tutorial/lessons/03_umpire_allocator/solution/03_umpire_allocator_solution.cpp index c760c81..24df8d0 100644 --- a/Intro_Tutorial/lessons/03_umpire_allocator/solution/03_umpire_allocator_solution.cpp +++ b/Intro_Tutorial/lessons/03_umpire_allocator/solution/03_umpire_allocator_solution.cpp @@ -10,7 +10,7 @@ int main() // TODO: allocate an array of 100 doubles using the HOST allocator auto& rm = umpire::ResourceManager::getInstance(); auto allocator = rm.getAllocator("HOST"); - void* data = allocator.allocate(100*sizeof(double)); + data = static_cast(allocator.allocate(100*sizeof(double))); std::cout << "Address of data: " << data << std::endl; From 38d5edf5391a9856543e585a6805e25288621cc5 Mon Sep 17 00:00:00 2001 From: Arturo Vargas Date: Sun, 1 Sep 2024 13:54:49 -0700 Subject: [PATCH 4/4] add missing N to example 4 --- Intro_Tutorial/lessons/04_raja_forall/04_raja_forall.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Intro_Tutorial/lessons/04_raja_forall/04_raja_forall.cpp b/Intro_Tutorial/lessons/04_raja_forall/04_raja_forall.cpp index 7b4f798..a0ad940 100644 --- a/Intro_Tutorial/lessons/04_raja_forall/04_raja_forall.cpp +++ b/Intro_Tutorial/lessons/04_raja_forall/04_raja_forall.cpp @@ -7,10 +7,12 @@ int main() { double* data{nullptr}; + constexpr int N = 100; + auto& rm = umpire::ResourceManager::getInstance(); auto allocator = rm.getAllocator("HOST"); - data = static_cast(allocator.allocate(100*sizeof(double))); + data = static_cast(allocator.allocate(N*sizeof(double))); std::cout << "Address of data: " << data << std::endl;