-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #238 from ye-luo/update-containers
Update containers as QMCPACK
- Loading branch information
Showing
3 changed files
with
68 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,22 +8,27 @@ | |
// | ||
// File created by: Ye Luo, [email protected], Argonne National Laboratory | ||
////////////////////////////////////////////////////////////////////////////////////// | ||
// -*- C++ -*- | ||
/** @file MemorySpace.hpp | ||
*/ | ||
#ifndef QMCPLUSPLUS_MEMORYSPACE_H | ||
#define QMCPLUSPLUS_MEMORYSPACE_H | ||
|
||
|
||
#ifndef QMCPLUSPLUS_ACCESS_TRAITS_H | ||
#define QMCPLUSPLUS_ACCESS_TRAITS_H | ||
|
||
namespace qmcplusplus | ||
{ | ||
struct MemorySpace | ||
/** template class defines whether the memory allocated by the allocator is host accessible | ||
*/ | ||
template<class Allocator> | ||
struct allocator_traits | ||
{ | ||
enum | ||
{ | ||
HOST = 0, | ||
CUDA | ||
}; | ||
const static bool is_host_accessible = true; | ||
}; | ||
|
||
template<class Allocator> | ||
using IsHostSafe = typename std::enable_if<allocator_traits<Allocator>::is_host_accessible>::type; | ||
|
||
template<class Allocator> | ||
using IsNotHostSafe = typename std::enable_if<!allocator_traits<Allocator>::is_host_accessible>::type; | ||
|
||
} // namespace qmcplusplus | ||
|
||
#endif | ||
#endif // QMCPLUSPLUS_ACCESS_TRAITS_H |