NVIDIA/libcudacxx

Redistributable

seanbaxter opened this issue · 8 comments

I'm interested in supporting this library on my own compiler. Do you provide a binary redistributable that covers the non-header portions of the library? Would that be hiding in the hpc toolkit somewhere? Basically I'm looking for guidance on deployment.

It's header only - there's no binary component.

Bryce beat me to the punch.

Our CMake configuration is there to make lit happy enough to chew through our tests. It does not currently install or build anything and is better off ignored for most end user things.

We don't really have any platform specific configuration we do at CMake configure time, most of our checks are in the __config headers. If Circle emits the right macros things maybe should work fine? I'd be happy to triage any issues if you encounter them.

How is it header only? I'm looking at dozens of .cpp files full of definitions that have to be compiled.

Here's the declaration for cout:
https://github.com/NVIDIA/libcudacxx/blob/main/include/cuda/std/detail/libcxx/include/iostream#L53

Here's its definition, in a cpp file:
https://github.com/NVIDIA/libcudacxx/blob/main/libcxx/src/iostream.cpp#L38

Here's the decaration for operator new:
https://github.com/NVIDIA/libcudacxx/blob/main/include/cuda/std/detail/libcxx/include/new#L188

Here's it's definition, in a cpp file:
https://github.com/NVIDIA/libcudacxx/blob/main/libcxx/src/new.cpp#L62

As you may have noticed, the headers you linked are deep within a "detail" directory. Only headers that are directly in include/cuda and include/cuda/std are supported at this time.

You are correct, those are functional underpinnings of our library. However, we do not expose those to users.

The only front-end that should be available to users are the files located in include/cuda/std anything below that directory is outside of the scope of what libcudacxx supports.

Yes, someone could forcefully include include/cuda/std/detail/libcxx/include/iostream, but that would quickly fail for a variety of reasons. (e.g. https://stackoverflow.com/questions/68075342/how-do-i-properly-include-files-from-the-nvidia-c-standard-library)

Libcudacxx is an extremely slim implementation of some memory model fundamentals, synchronization, and a growing subset of utilities. Things like memory allocation and iostream are on the roadmap, but will require more design and time. :(

I'm not expecting to use any of that stuff on the device. My understanding is that this is a fork of libc++ with some special sauce for GPU, but that it provides a standard lib for the whole system. How do I use iostreams, etc, on the host? I wouldn't be simultaneously including both libcudacxx and libstdc++, rigth?

We should be non-interfering with host standard libraries! To the best of my knowledge that hasn't been broken yet except for some weird ADL stuff going on in GCC-9.

Your understanding is incorrect. At this time, libcu++ does not implement namespace std, but implements versions of a partial subset of it as cuda::std, and extentions to some of these (plus some additional APIs) in namespace cuda.

Please refer to the documentation to see what is supported at this time.