From 8331a7ff3c9b1b187939b8ec3c34c81c0029c11d Mon Sep 17 00:00:00 2001 From: "John F. Carr" Date: Fri, 23 Jan 2026 09:53:05 -0700 Subject: [PATCH 1/4] Keyword renaming is not needed if __cilk >= 301 --- include/cilk/cilk.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/cilk/cilk.h b/include/cilk/cilk.h index 7014987a..c5fcde2f 100644 --- a/include/cilk/cilk.h +++ b/include/cilk/cilk.h @@ -1,6 +1,8 @@ #ifndef _CILK_H #define _CILK_H +#if __cilk < 301 + #define cilk_spawn _Cilk_spawn #define cilk_sync _Cilk_sync #define cilk_for _Cilk_for @@ -8,4 +10,6 @@ #define cilk_reducer _Hyperobject +#endif + #endif /* _CILK_H */ From 31adb1b8f3d76ff962b926facf85715026c41207 Mon Sep 17 00:00:00 2001 From: "John F. Carr" Date: Fri, 23 Jan 2026 09:53:57 -0700 Subject: [PATCH 2/4] Rename holder.h to holder as a C++-only header --- include/CMakeLists.txt | 2 +- include/cilk/{holder.h => holder} | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) rename include/cilk/{holder.h => holder} (79%) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index b6ff20c5..102ef44d 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -2,7 +2,7 @@ set(cilk_header_files cilk/cilk.h cilk/cilk_api.h cilk/cilk_stub.h - cilk/holder.h + cilk/holder cilk/opadd_reducer.h cilk/ostream_reducer.h cilk/reducer) diff --git a/include/cilk/holder.h b/include/cilk/holder similarity index 79% rename from include/cilk/holder.h rename to include/cilk/holder index 2f36e770..1a8a743d 100644 --- a/include/cilk/holder.h +++ b/include/cilk/holder @@ -1,8 +1,6 @@ #ifndef _HOLDER_H #define _HOLDER_H -#ifdef __cplusplus - #include namespace cilk { @@ -16,10 +14,8 @@ template static void reduce(void *left, void *right) { } template -using holder = A _Hyperobject(init, reduce); +using holder = A cilk_reducer(init, reduce); } // namespace cilk -#endif // __cplusplus - #endif // _HOLDER_H From 4f647c52acc32841f356ea6be50bf69bb4fffb09 Mon Sep 17 00:00:00 2001 From: "John F. Carr" Date: Fri, 23 Jan 2026 09:55:15 -0700 Subject: [PATCH 3/4] Rename opadd_reducer.h to opadd_reducer as a C++-only header --- include/CMakeLists.txt | 2 +- include/cilk/{opadd_reducer.h => opadd_reducer} | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) rename include/cilk/{opadd_reducer.h => opadd_reducer} (75%) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 102ef44d..8f6c4925 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -3,7 +3,7 @@ set(cilk_header_files cilk/cilk_api.h cilk/cilk_stub.h cilk/holder - cilk/opadd_reducer.h + cilk/opadd_reducer cilk/ostream_reducer.h cilk/reducer) diff --git a/include/cilk/opadd_reducer.h b/include/cilk/opadd_reducer similarity index 75% rename from include/cilk/opadd_reducer.h rename to include/cilk/opadd_reducer index be7c2696..b8118ff2 100644 --- a/include/cilk/opadd_reducer.h +++ b/include/cilk/opadd_reducer @@ -1,8 +1,6 @@ #ifndef _OPADD_REDUCER_H #define _OPADD_REDUCER_H -#ifdef __cplusplus - namespace cilk { template static void zero(void *v) { @@ -13,10 +11,8 @@ template static void plus(void *l, void *r) { *static_cast(l) += *static_cast(r); } -template using opadd_reducer = T _Hyperobject(zero, plus); +template using opadd_reducer = T cilk_reducer(zero, plus); } // namespace cilk -#endif // #ifdef __cplusplus - #endif // _OPADD_REDUCER_H From 371ab33e3c190a8db4bc3824cfebcb3e48b798ee Mon Sep 17 00:00:00 2001 From: "John F. Carr" Date: Fri, 23 Jan 2026 10:03:57 -0700 Subject: [PATCH 4/4] Rename ostream_reducer.h to ostream_reducer as a C++-only header --- include/CMakeLists.txt | 2 +- include/cilk/{ostream_reducer.h => ostream_reducer} | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) rename include/cilk/{ostream_reducer.h => ostream_reducer} (91%) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 8f6c4925..25bc294f 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -4,7 +4,7 @@ set(cilk_header_files cilk/cilk_stub.h cilk/holder cilk/opadd_reducer - cilk/ostream_reducer.h + cilk/ostream_reducer cilk/reducer) set(output_dir ${CHEETAH_OUTPUT_DIR}/include) diff --git a/include/cilk/ostream_reducer.h b/include/cilk/ostream_reducer similarity index 91% rename from include/cilk/ostream_reducer.h rename to include/cilk/ostream_reducer index 88113132..07449c17 100644 --- a/include/cilk/ostream_reducer.h +++ b/include/cilk/ostream_reducer @@ -1,8 +1,6 @@ #ifndef _OSTREAM_REDUCER_H #define _OSTREAM_REDUCER_H -#ifdef __cplusplus - #include #include @@ -64,11 +62,9 @@ class ostream_view : public std::basic_ostream template> using ostream_reducer = ostream_view - _Hyperobject(&ostream_view>::identity, - &ostream_view>::reduce); + cilk_reducer(&ostream_view::identity, + &ostream_view::reduce); } // namespace cilk -#endif // __cplusplus - #endif // _OSTREAM_REDUCER_H