mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01: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);
|
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
|
// Minimal base class containing only data valid to access from accelerator
|
||||||
// _odata will be a managed pointer in CUDA
|
// _odata will be a managed pointer in CUDA
|
||||||
@ -77,12 +85,12 @@ public:
|
|||||||
else grid = _grid;
|
else grid = _grid;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Advise that the data is used infrequently. This can
|
accelerator_inline void Advise(int advise) {
|
||||||
// significantly influence performance of bulk storage.
|
|
||||||
accelerator_inline void AdviseInfrequentUse() {
|
|
||||||
#ifdef GRID_NVCC
|
#ifdef GRID_NVCC
|
||||||
#ifndef __CUDA_ARCH__ // only on host
|
#ifndef __CUDA_ARCH__ // only on host
|
||||||
cudaMemAdvise(_odata,_odata_size*sizeof(vobj),cudaMemAdviseSetPreferredLocation,cudaCpuDeviceId);
|
if (advise & AdviseInfrequentUse) {
|
||||||
|
cudaMemAdvise(_odata,_odata_size*sizeof(vobj),cudaMemAdviseSetPreferredLocation,cudaCpuDeviceId);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user