Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Merge pull request #3017 from JieyangChen7/fix-gpu-library-conflict-issue" #3022

Closed
Closed
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
12 changes: 8 additions & 4 deletions source/adios2/helper/adiosCUDA.cu
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,22 @@
#define ADIOS2_HELPER_ADIOSCUDA_CU_

#include "adios2/common/ADIOSMacros.h"
#include <thrust/device_ptr.h>
#include <thrust/extrema.h>

#include "adiosCUDA.h"
#include "adiosCUDAReduceImpl.h"

namespace
{

template <class T>
void CUDAMinMaxImpl(const T *values, const size_t size, T &min, T &max)
{
min = reduce<T, MinOp>(size, 1024, 64, 1, values);
max = reduce<T, MaxOp>(size, 1024, 64, 1, values);
thrust::device_ptr<const T> dev_ptr(values);
auto res = thrust::minmax_element(dev_ptr, dev_ptr + size);
cudaMemcpy(&min, thrust::raw_pointer_cast(res.first), sizeof(T),
cudaMemcpyDeviceToHost);
cudaMemcpy(&max, thrust::raw_pointer_cast(res.second), sizeof(T),
cudaMemcpyDeviceToHost);
}
// types non supported on the device
void CUDAMinMaxImpl(const long double * /*values*/, const size_t /*size*/,
Expand Down
Loading