mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-10 07:55:35 +00:00
interface cleanup
This commit is contained in:
parent
949be9605c
commit
38532753f4
@ -50,6 +50,14 @@ void accelerator_inline conformable(GridBase *lhs,GridBase *rhs)
|
||||
assert(lhs == rhs);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Advise for memory management
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
enum LatticeAcceleratorAdvise {
|
||||
AdviseInfrequentUse = 0x1 // Advise that the data is used infrequently. This can
|
||||
// significantly influence performance of bulk storage.
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Minimal base class containing only data valid to access from accelerator
|
||||
// _odata will be a managed pointer in CUDA
|
||||
@ -77,12 +85,12 @@ public:
|
||||
else grid = _grid;
|
||||
};
|
||||
|
||||
// Advise that the data is used infrequently. This can
|
||||
// significantly influence performance of bulk storage.
|
||||
accelerator_inline void AdviseInfrequentUse() {
|
||||
accelerator_inline void Advise(int advise) {
|
||||
#ifdef GRID_NVCC
|
||||
#ifndef __CUDA_ARCH__ // only on host
|
||||
if (advise & AdviseInfrequentUse) {
|
||||
cudaMemAdvise(_odata,_odata_size*sizeof(vobj),cudaMemAdviseSetPreferredLocation,cudaCpuDeviceId);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user