Go to the documentation of this file. 1 #ifndef HeterogeneousCore_CUDACore_ESProduct_h
2 #define HeterogeneousCore_CUDACore_ESProduct_h
39 if (not
data.m_filled.load()) {
41 std::scoped_lock<std::mutex> lk{
data.m_mutex};
43 if (
data.m_filled.load()) {
48 if (
data.m_fillingStream !=
nullptr) {
56 auto should_be_false =
data.m_filled.exchange(
true);
57 assert(not should_be_false);
58 data.m_fillingStream =
nullptr;
59 }
else if (
data.m_fillingStream != cudaStream) {
64 cudaCheck(cudaStreamWaitEvent(cudaStream,
data.m_event.get(), 0),
65 "Failed to make a stream to wait for an event");
75 transferAsync(
data.m_data, cudaStream);
77 data.m_fillingStream = cudaStream;
std::shared_ptr< std::remove_pointer_t< cudaEvent_t > > SharedEventPtr
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
const T & dataForCurrentDeviceAsync(cudaStream_t cudaStream, F transferAsync) const
std::atomic< bool > m_filled
cudaStream_t m_fillingStream
bool eventWorkHasCompleted(cudaEvent_t event)
#define cudaCheck(ARG,...)
std::vector< Item > gpuDataPerDevice_
char data[epos_bytes_allocation]
#define CMS_THREAD_GUARD(_var_)
EventCache & getEventCache()
Namespace of DDCMS conversion namespace.