Skip to content

Instantly share code, notes, and snippets.

@griwes
Created November 29, 2019 01:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save griwes/041b2ca7454bfd96cb45ae7187287937 to your computer and use it in GitHub Desktop.
Save griwes/041b2ca7454bfd96cb45ae7187287937 to your computer and use it in GitHub Desktop.

We don't really have docs at this point in time, just getting the lib out of the door was quite the chunk of work; but all the things we expose follow the ISO C++ standard, and its standard library, and cppreference is a good source of documentation for that. In CUDA 10.2, we provide the contents of <cstddef>, <cstdint>, <type_traits>, and <atomic>, except in cuda::std:: instead of std::, and in <cuda/std/cstddef> and so on instead of <cstddef>. Additionally, there's cuda::atomic<T, Scope>, which provides scoped atomics; the available scopes are cuda::thread_scope_{block,device,system}. cuda::std::atomic uses cuda::thread_scope_system, and atomics only free you of data races within the specified scope.

All the things provided work both on the host and on the device, and are layout compatible, which means that you can also use them in managed memory heterogeneously between the host and the device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment