Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ set(cilk_header_files
cilk/cilk.h
cilk/cilk_api.h
cilk/cilk_stub.h
cilk/holder.h
cilk/opadd_reducer.h
cilk/ostream_reducer.h
cilk/holder
cilk/opadd_reducer
cilk/ostream_reducer
cilk/reducer)

set(output_dir ${CHEETAH_OUTPUT_DIR}/include)
Expand Down
4 changes: 4 additions & 0 deletions include/cilk/cilk.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#ifndef _CILK_H
#define _CILK_H

#if __cilk < 301

#define cilk_spawn _Cilk_spawn
#define cilk_sync _Cilk_sync
#define cilk_for _Cilk_for
#define cilk_scope _Cilk_scope

#define cilk_reducer _Hyperobject

#endif

#endif /* _CILK_H */
6 changes: 1 addition & 5 deletions include/cilk/holder.h → include/cilk/holder
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef _HOLDER_H
#define _HOLDER_H

#ifdef __cplusplus

#include <type_traits>

namespace cilk {
Expand All @@ -16,10 +14,8 @@ template <typename A> static void reduce(void *left, void *right) {
}

template <typename A>
using holder = A _Hyperobject(init<A>, reduce<A>);
using holder = A cilk_reducer(init<A>, reduce<A>);

} // namespace cilk

#endif // __cplusplus

#endif // _HOLDER_H
6 changes: 1 addition & 5 deletions include/cilk/opadd_reducer.h → include/cilk/opadd_reducer
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef _OPADD_REDUCER_H
#define _OPADD_REDUCER_H

#ifdef __cplusplus

namespace cilk {

template <typename T> static void zero(void *v) {
Expand All @@ -13,10 +11,8 @@ template <typename T> static void plus(void *l, void *r) {
*static_cast<T *>(l) += *static_cast<T *>(r);
}

template <typename T> using opadd_reducer = T _Hyperobject(zero<T>, plus<T>);
template <typename T> using opadd_reducer = T cilk_reducer(zero<T>, plus<T>);

} // namespace cilk

#endif // #ifdef __cplusplus

#endif // _OPADD_REDUCER_H
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef _OSTREAM_REDUCER_H
#define _OSTREAM_REDUCER_H

#ifdef __cplusplus

#include <ostream>
#include <sstream>

Expand Down Expand Up @@ -64,11 +62,9 @@ class ostream_view : public std::basic_ostream<Char, Traits>

template<typename Char, typename Traits = std::char_traits<Char>>
using ostream_reducer = ostream_view<Char, Traits>
_Hyperobject(&ostream_view<Char, std::char_traits<Char>>::identity,
&ostream_view<Char, std::char_traits<Char>>::reduce);
cilk_reducer(&ostream_view<Char, Traits>::identity,
&ostream_view<Char, Traits>::reduce);

} // namespace cilk

#endif // __cplusplus

#endif // _OSTREAM_REDUCER_H
Loading