- Notifications
You must be signed in to change notification settings - Fork191
[ARCHIVED] The C++ Standard Library for your entire system. Seehttps://github.com/NVIDIA/cccl
License
NVIDIA/libcudacxx
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
| Examples | Godbolt | Documentation |
|---|
libcu++, the NVIDIA C++ Standard Library, is the C++ Standard Library foryour entire system.It provides a heterogeneous implementation of the C++ Standard Library that canbe used in and between CPU and GPU code.
If you know how to use your C++ Standard Library, then you know how to uselibcu++.All you have to do is addcuda/std/ to the start of your Standard Libraryincludes andcuda:: before any uses ofstd:::
#include<cuda/std/atomic>cuda::std::atomic<int> x;
The NVIDIA C++ Standard Library is an open source project; it is available onGitHub and included in the NVIDIA HPC SDK and CUDA Toolkit.If you have one of those SDKs installed, no additional installation or compilerflags are needed to use libcu++.
When used with NVCC, NVIDIA C++ Standard Library facilities live in their ownheader hierarchy and namespace with the same structure as, but distinct from,the host compiler's Standard Library:
std::/<*>: When using NVCC, this is your host compiler's Standard Librarythat works in__host__code only, although you can use the--expt-relaxed-constexprflag to use anyconstexprfunctions in__device__code.With NVCC, libcu++ does not replace or interfere with host compiler'sStandard Library.cuda::std::/<cuda/std/*>: Strictly conforming implementations offacilities from the Standard Library that work in__host__ __device__code.cuda::/<cuda/*>: Conforming extensions to the Standard Library thatwork in__host__ __device__code.cuda::device/<cuda/device/*>: Conforming extensions to the StandardLibrary that work only in__device__code.
// Standard C++, __host__ only.#include<atomic>std::atomic<int> x;// CUDA C++, __host__ __device__.// Strictly conforming to the C++ Standard.#include<cuda/std/atomic>cuda::std::atomic<int> x;// CUDA C++, __host__ __device__.// Conforming extensions to the C++ Standard.#include<cuda/atomic>cuda::atomic<int, cuda::thread_scope_block> x;
The NVIDIA C++ Standard Library works across your entire codebase, both in andacross host and device code.libcu++ is a C++ Standard Library for your entire system, not just your CPU orGPU.Everything incuda:: is__host__ __device__.
libcu++ facilities are designed to be passed between host and device code.Unless otherwise noted, any libcu++ object which is copyable or movable can becopied or moved between host and device code.
Synchronization objects work across host and device code, and can be used tosynchronize between host and device threads.However, there are some restrictions to be aware of; please see thesynchronization primitives section for more details.
A small number of libcu++ facilities only work in device code, usually becausethere is no sensible implementation in host code.
Such facilities live incuda::device::.
Today, the NVIDIA C++ Standard Library delivers a high-priority subset of theC++ Standard Library today, and each release increases the feature set.But it is a subset; not everything is available today.TheStandard API section lists the facilities available and the releases theywere first introduced in.
The NVIDIA C++ Standard Library is an open source project developed onGitHub.It is NVIDIA's variant ofLLVM's libc++.libcu++ is distributed under theApache License v2.0 with LLVM Exceptions.
The NVIDIA C++ Standard Library aims to be a conforming implementation of theC++ Standard,ISO/IEC IS 14882, Clause 16 through 32.
The NVIDIA C++ Standard Library does not maintain long-term ABI stability.Promising long-term ABI stability would prevent us from fixing mistakes andproviding best in class performance.So, we make no such promises.
Every major CUDA Toolkit release, the ABI will be broken.The life cycle of an ABI version is approximately one year.Long-term support for an ABI version ends after approximately two years.Please see theversioning section for more details.
We recommend that you always recompile your code and dependencies with thelatest NVIDIA SDKs and use the latest NVIDIA C++ Standard Library ABI.Live at head.
About
[ARCHIVED] The C++ Standard Library for your entire system. Seehttps://github.com/NVIDIA/cccl
Topics
Resources
License
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.