copies in device memory of the fields which are not accessible by the device associated with a queue. The outputs must be copied back by calling the copyOutputs method.
More...
#include </home/runner/work/tfel/tfel/mfront/include/MFront/GenericParallel/SYCLDeviceCopies.hxx>
|
| | DeviceCopies (::sycl::queue &q, const size_type n, const DataTransferPolicy p) |
| | constructor
|
|
| DeviceCopies (DeviceCopies &&)=delete |
|
| DeviceCopies (const DeviceCopies &)=delete |
|
DeviceCopies & | operator= (DeviceCopies &&)=delete |
|
DeviceCopies & | operator= (const DeviceCopies &)=delete |
| template<typename FieldType> |
| void | transfer (FieldType &f, const size_type size, const bool output) |
| | copy a field in device memory if it is not accessible by the device, and make the field refer to the copy. All the values covered by the strides of the field are copied. For an output, only the values of the field are copied back, so that the values of other outputs sharing the same memory (for example, the thermodynamic forces and the internal state variables of a point stored contiguously) are not overwritten.
|
| template<typename ValueType> |
| void | transfer (ValueType *&p, const size_type size, const bool output) |
| | copy an array in device memory if it is not accessible by the device, and make the pointer refer to the copy.
|
|
void | copyOutputs () |
| | copy the outputs back to their original locations, once the computations submitted to the queue are completed
|
| bool | isAccessible (const void *const p) const |
| bool | isEnabled () const noexcept |
| bool | holdsCopies () const noexcept |
|
| ~DeviceCopies () |
| | destructor
|
copies in device memory of the fields which are not accessible by the device associated with a queue. The outputs must be copied back by calling the copyOutputs method.
◆ DeviceCopies()
constructor
- Parameters
-
| [in] | q | queue |
| [in] | n | number of points of the fields |
| [in] | p | policy for the transfer of the fields. With the NONE policy, no copy is made. |
◆ holdsCopies()
| bool mfront::generic_parallel::sycl::DeviceCopies::holdsCopies |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
- Returns
- if some arrays have been copied
◆ isAccessible()
| bool mfront::generic_parallel::sycl::DeviceCopies::isAccessible |
( |
const void *const | p | ) |
const |
|
inlinenodiscard |
- Returns
- if the given pointer is accessible by the device: any pointer if the device is a CPU, the memory allocated by SYCL (unified shared memory) otherwise
- Parameters
-
◆ isEnabled()
| bool mfront::generic_parallel::sycl::DeviceCopies::isEnabled |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
- Returns
- if the arrays which are not accessible are copied
◆ transfer() [1/2]
template<typename FieldType>
| void mfront::generic_parallel::sycl::DeviceCopies::transfer |
( |
FieldType & | f, |
|
|
const size_type | size, |
|
|
const bool | output ) |
|
inline |
copy a field in device memory if it is not accessible by the device, and make the field refer to the copy. All the values covered by the strides of the field are copied. For an output, only the values of the field are copied back, so that the values of other outputs sharing the same memory (for example, the thermodynamic forces and the internal state variables of a point stored contiguously) are not overwritten.
- Parameters
-
| [in,out] | f | field |
| [in] | size | number of components |
| [in] | output | if true, the field is an output |
◆ transfer() [2/2]
template<typename ValueType>
| void mfront::generic_parallel::sycl::DeviceCopies::transfer |
( |
ValueType *& | p, |
|
|
const size_type | size, |
|
|
const bool | output ) |
|
inline |
copy an array in device memory if it is not accessible by the device, and make the pointer refer to the copy.
- Parameters
-
| [in,out] | p | pointer to the array |
| [in] | size | number of values |
| [in] | output | if true, the array is an output |
The documentation for this struct was generated from the following file: