1 #ifndef HeterogeneousCore_CUDACore_ESProduct_h 2 #define HeterogeneousCore_CUDACore_ESProduct_h 43 if (not
data.m_filled.load()) {
45 std::scoped_lock<std::mutex> lk{
data.m_mutex};
47 if (
data.m_filled.load()) {
52 if (
data.m_fillingStream !=
nullptr) {
60 auto should_be_false =
data.m_filled.exchange(
true);
61 assert(not should_be_false);
62 data.m_fillingStream =
nullptr;
63 }
else if (
data.m_fillingStream != cudaStream) {
68 cudaCheck(cudaStreamWaitEvent(cudaStream,
data.m_event.get(), 0),
69 "Failed to make a stream to wait for an event");
79 transferAsync(
data.m_data, cudaStream);
81 data.m_fillingStream = cudaStream;
110 #endif // HeterogeneousCore_CUDACore_ESProduct_h const T & dataForCurrentDeviceAsync(cudaStream_t cudaStream, F transferAsync) const
std::shared_ptr< std::remove_pointer_t< cudaEvent_t > > SharedEventPtr
cudaStream_t m_fillingStream
#define CMS_THREAD_GUARD(_var_)
Namespace of DDCMS conversion namespace.
std::vector< Item > gpuDataPerDevice_
std::atomic< bool > m_filled
char data[epos_bytes_allocation]
EventCache & getEventCache()
#define cudaCheck(ARG,...)
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
bool eventWorkHasCompleted(cudaEvent_t event)