mirror of
https://github.com/paboyle/Grid.git
synced 2024-11-09 23:45:36 +00:00
Put/Get and DEviceToDevice
This commit is contained in:
parent
9c2565f64e
commit
5e5b471bb2
@ -275,6 +275,7 @@ inline void acceleratorCopyDeviceToDeviceAsynch(void *from,void *to,size_t bytes
|
|||||||
}
|
}
|
||||||
inline void acceleratorCopySynchronise(void) { cudaStreamSynchronize(copyStream); };
|
inline void acceleratorCopySynchronise(void) { cudaStreamSynchronize(copyStream); };
|
||||||
|
|
||||||
|
|
||||||
inline int acceleratorIsCommunicable(void *ptr)
|
inline int acceleratorIsCommunicable(void *ptr)
|
||||||
{
|
{
|
||||||
// int uvm=0;
|
// int uvm=0;
|
||||||
@ -533,6 +534,12 @@ inline void acceleratorCopySynchronise(void) { auto discard=hipStreamSynchronize
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
inline void acceleratorCopyDeviceToDevice(void *from,void *to,size_t bytes)
|
||||||
|
{
|
||||||
|
acceleratorCopyDeviceToDeviceAsynch(from,to,bytes);
|
||||||
|
acceleratorCopySynchronise();
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////
|
//////////////////////////////////////////////
|
||||||
// CPU Target - No accelerator just thread instead
|
// CPU Target - No accelerator just thread instead
|
||||||
//////////////////////////////////////////////
|
//////////////////////////////////////////////
|
||||||
@ -644,4 +651,17 @@ accelerator_inline void acceleratorFence(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class T> void acceleratorPut(T& dev,T&host)
|
||||||
|
{
|
||||||
|
acceleratorCopyToDevice(&host,&dev,sizeof(T));
|
||||||
|
}
|
||||||
|
template<class T> T acceleratorGet(T& dev)
|
||||||
|
{
|
||||||
|
T host;
|
||||||
|
acceleratorCopyFromDevice(&dev,&host,sizeof(T));
|
||||||
|
return host;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NAMESPACE_END(Grid);
|
NAMESPACE_END(Grid);
|
||||||
|
Loading…
Reference in New Issue
Block a user