parent
d12af1075c
commit
6d11c72382
@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
|
|||||||
## Unreleased
|
## Unreleased
|
||||||
### Added
|
### Added
|
||||||
- Ability to build Kokkos and RAJA versions against existing packages.
|
- Ability to build Kokkos and RAJA versions against existing packages.
|
||||||
|
- Thrust managed memory.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- RAJA CUDA CMake build issues resolved.
|
- RAJA CUDA CMake build issues resolved.
|
||||||
|
|||||||
@ -8,7 +8,11 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#if defined(MANAGED)
|
||||||
|
#include <thrust/universal_vector.h>
|
||||||
|
#else
|
||||||
#include <thrust/device_vector.h>
|
#include <thrust/device_vector.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "Stream.h"
|
#include "Stream.h"
|
||||||
|
|
||||||
@ -21,9 +25,15 @@ class ThrustStream : public Stream<T>
|
|||||||
// Size of arrays
|
// Size of arrays
|
||||||
int array_size;
|
int array_size;
|
||||||
|
|
||||||
|
#if defined(MANAGED)
|
||||||
|
thrust::universtal_vector<T> a;
|
||||||
|
thrust::universtal_vector<T> b;
|
||||||
|
thrust::universtal_vector<T> c;
|
||||||
|
#else
|
||||||
thrust::device_vector<T> a;
|
thrust::device_vector<T> a;
|
||||||
thrust::device_vector<T> b;
|
thrust::device_vector<T> b;
|
||||||
thrust::device_vector<T> c;
|
thrust::device_vector<T> c;
|
||||||
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ThrustStream(const int, int);
|
ThrustStream(const int, int);
|
||||||
|
|||||||
@ -18,6 +18,9 @@ register_flag_optional(BACKEND
|
|||||||
"
|
"
|
||||||
"CUDA")
|
"CUDA")
|
||||||
|
|
||||||
|
register_flag_optional(MANAGED "Enabled managed memory mode."
|
||||||
|
"OFF")
|
||||||
|
|
||||||
register_flag_optional(CMAKE_CUDA_COMPILER
|
register_flag_optional(CMAKE_CUDA_COMPILER
|
||||||
"[THRUST_IMPL==CUDA] Path to the CUDA nvcc compiler"
|
"[THRUST_IMPL==CUDA] Path to the CUDA nvcc compiler"
|
||||||
"")
|
"")
|
||||||
@ -34,6 +37,9 @@ register_flag_optional(CUDA_EXTRA_FLAGS
|
|||||||
|
|
||||||
macro(setup)
|
macro(setup)
|
||||||
set(CMAKE_CXX_STANDARD 14)
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
|
if (MANAGED)
|
||||||
|
register_definitions(MANAGED)
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (${THRUST_IMPL} STREQUAL "CUDA")
|
if (${THRUST_IMPL} STREQUAL "CUDA")
|
||||||
|
|
||||||
@ -91,4 +97,4 @@ macro(setup)
|
|||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user