CMS 3D CMS Logo

cms::alpakatools::CopyToHost< TDeviceData > Struct Template Reference

#include <CopyToHost.h>

Detailed Description

template<typename TDeviceData>
struct cms::alpakatools::CopyToHost< TDeviceData >

This class template needs to be specialized for each device-side Event data product so that the framework can implicitly copy the device-side data product to the host memory. The specialization is expected to define static copyAsync() function as in the following example

template <>
struct CopyToHost<ExampleDeviceProduct> {
template <typename TQueue>
static ExampleHostProduct copyAsync(TQueue& queue, ExampleDeviceProduct const& deviceData) {
// construct ExampleHostProduct
// asynchronous copy deviceData to the ExampleHostProduct object
// return ExampleHostProduct object by value
}
};

The copyAsync() function should not explicitly synchronize the queue. The ExampleDeviceProduct and ExampleHostProduct can be the same type, if they internally are able to handle the memory allocation difference between host and device.

Definition at line 33 of file CopyToHost.h.