Quantcast
Channel: initialisation of atomic init - Stack Overflow
Browsing all 2 articles
Browse latest View live

Answer by Brian Bi for initialisation of atomic init

In your code it appears that you're trying to create std::atomic<uint> objects out of "raw memory". If that's the case then you need to use placement new to begin the lifetime of such an object...

View Article



initialisation of atomic init

So in my code there is the snippet:std::atomic<uint>* atomic_buffer = reinterpret_cast<std::atomic<uint>*>(data);const size_t num_atomic_elements = svm_data_size /...

View Article
Browsing all 2 articles
Browse latest View live




Latest Images