Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzalobg committed Jun 5, 2024
1 parent 8867a86 commit 1199c83
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 855 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ register_model(hip HIP HIPStream.cpp)
register_model(cuda CUDA CUDAStream.cu)
register_model(kokkos KOKKOS KokkosStream.cpp)
register_model(sycl SYCL SYCLStream.cpp)
register_model(sycl2020-acc SYCL2020 SYCLStream2020.cpp)
register_model(sycl2020-usm SYCL2020 SYCLStream2020.cpp)
register_model(sycl2020 SYCL2020 SYCLStream2020.cpp)
register_model(acc ACC ACCStream.cpp)
# defining RAJA collides with the RAJA namespace so USE_RAJA
register_model(raja USE_RAJA RAJAStream.cpp)
Expand Down
16 changes: 8 additions & 8 deletions src/std/STDStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <algorithm>
#include <execution>

#if defined(DATA20) || defined(INDICES)
#if defined(DATA23) || defined(INDICES)
#include <ranges>
#endif

Expand Down Expand Up @@ -89,7 +89,7 @@ template <class T>
void STDStream<T>::copy()
{
// c[i] = a[i]
#if defined(DATA17) || defined(DATA20)
#if defined(DATA17) || defined(DATA23)
std::copy(exe_policy, a, a + array_size, c);
#elif INDICES
std::for_each_n(exe_policy, counting_iter(0), array_size, [a=a,c=c](intptr_t i) {
Expand All @@ -104,7 +104,7 @@ template <class T>
void STDStream<T>::mul()
{
// b[i] = scalar * c[i];
#if defined(DATA17) || defined(DATA20)
#if defined(DATA17) || defined(DATA23)
std::transform(exe_policy, c, c + array_size, b, [](T ci){ return startScalar*ci; });
#elif INDICES
std::for_each_n(exe_policy, counting_iter(0), array_size, [b=b, c=c](intptr_t i) {
Expand All @@ -119,7 +119,7 @@ template <class T>
void STDStream<T>::add()
{
// c[i] = a[i] + b[i];
#if defined(DATA17) || defined(DATA20)
#if defined(DATA17) || defined(DATA23)
std::transform(exe_policy, a, a + array_size, b, c, std::plus<T>());
#elif INDICES
std::for_each_n(exe_policy, counting_iter(0), array_size, [a=a, b=b, c=c](intptr_t i) {
Expand All @@ -134,7 +134,7 @@ template <class T>
void STDStream<T>::triad()
{
// a[i] = b[i] + scalar * c[i];
#if defined(DATA17) || defined(DATA20)
#if defined(DATA17) || defined(DATA23)
std::transform(exe_policy, b, b + array_size, c, a, [scalar = startScalar](T bi, T ci){ return bi+scalar*ci; });
#elif INDICES
std::for_each_n(exe_policy, counting_iter(0), array_size, [a=a, b=b, c=c](intptr_t i) {
Expand All @@ -149,13 +149,13 @@ template <class T>
void STDStream<T>::nstream()
{
// a[i] += b[i] + scalar * c[i];
#if defined(DATA17) || defined(DATA20) // Until we can require GCC 14.1
#if defined(DATA17) || defined(DATA23) // Until we can require GCC 14.1
// Need to do in two round-trips with C++17 STL.
// 1: a[i] += b[i]
// 2: a[i] += scalar * c[i];
std::transform(exe_policy, a, a + array_size, b, a, [](T ai, T bi){ return ai + bi; });
std::transform(exe_policy, a, a + array_size, c, a, [](T ai, T ci){ return ai + startScalar*ci; });
#elif DATA20
#elif DATA23
// Requires GCC 14.1 (Ubuntu 24.04):
auto as = std::ranges::subrange(a, a + array_size);
auto bs = std::ranges::subrange(b, b + array_size);
Expand All @@ -178,7 +178,7 @@ void STDStream<T>::nstream()
template <class T>
T STDStream<T>::dot()
{
#if defined(DATA17) || defined(DATA20)
#if defined(DATA17) || defined(DATA23)
// sum = 0; sum += a[i] * b[i]; return sum;
return std::transform_reduce(exe_policy, a, a + array_size, b, T{0});
#elif INDICES
Expand Down
4 changes: 2 additions & 2 deletions src/std/STDStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

#ifdef DATA17
#define STDIMPL "DATA17"
#elif DATA20
#define STDIMPL "DATA20"
#elif DATA23
#define STDIMPL "DATA23"
#elif INDICES
#define STDIMPL "INDICES"
#else
Expand Down
286 changes: 0 additions & 286 deletions src/sycl2020-acc/SYCLStream2020.cpp

This file was deleted.

Loading

0 comments on commit 1199c83

Please sign in to comment.