Skip to content

Commit f8166fd

Browse files
committed
stdpar Tutorial: Our patched ranges header has to be copied after GCC is installed. Also, add a macro to the header to allow us to confirm that it's installed.
1 parent 4f8a6a0 commit f8166fd

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

stdpar-tutorial/brev/docker-recipe.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@
2020
Stage0 += copy(src='.', dest='/accelerated-computing-hub')
2121
Stage0 += copy(src='brev/update-git-branch.bash', dest='/update-git-branch.bash')
2222

23-
# Patch libstdc++ to use our modified cartesian_product view that doesn't require HMM/ATS and copies
24-
# the underlying range iterators instead of accessing them through host memory.
25-
Stage0 += copy(src='stdpar-tutorial/include/ach/cartesian_product.hpp', dest='/usr/include/ach/cartesian_product.hpp')
26-
Stage0 += copy(src='stdpar-tutorial/include/ranges', dest=f'/usr/include/c++/{gcc_ver}/ranges')
27-
2823
Stage0 += workdir(directory=f'/accelerated-computing-hub/stdpar-tutorial/notebooks')
2924

3025
Stage0 += packages(ospackages=[
@@ -41,6 +36,12 @@
4136
Stage0 += gnu(version=gcc_ver, extra_repository=True)
4237
Stage0 += llvm(version=llvm_ver, upstream=True, extra_tools=True, toolset=True, _trunk_version='19')
4338

39+
# Patch libstdc++ to use our modified cartesian_product view that doesn't require HMM/ATS and copies
40+
# the underlying range iterators instead of accessing them through host memory. This must be done
41+
# after GCC is installed.
42+
Stage0 += copy(src='stdpar-tutorial/include/ach/cartesian_product.hpp', dest='/usr/include/ach/cartesian_product.hpp')
43+
Stage0 += copy(src='stdpar-tutorial/include/ranges', dest=f'/usr/include/c++/{gcc_ver}/ranges')
44+
4445
# Install CMake
4546
Stage0 += cmake(eula=True, version=cmake_ver)
4647

stdpar-tutorial/include/ranges

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#ifndef _GLIBCXX_RANGES
3232
#define _GLIBCXX_RANGES 1
3333

34+
#define _GLIBCXX_RANGES_FROM_ACH
35+
3436
#if __cplusplus > 201703L
3537

3638
#pragma GCC system_header

0 commit comments

Comments
 (0)