Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to using C++ compiler to compile the plugin #805

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

bwbarrett
Copy link
Contributor

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@bwbarrett bwbarrett force-pushed the feature/cppize-the-code branch from fd44226 to cdbf6bb Compare March 9, 2025 01:59
@bwbarrett bwbarrett force-pushed the feature/cppize-the-code branch 2 times, most recently from 64bd6fc to f172789 Compare March 12, 2025 16:37
@bwbarrett bwbarrett marked this pull request as ready for review March 13, 2025 14:28
@bwbarrett bwbarrett requested review from rajachan, rauteric and a team as code owners March 13, 2025 14:28
While all the code very much looks like C code, switch to using the C++
compiler to compile our code.  Step 1 in migrating to C++.

Signed-off-by: Brian Barrett <[email protected]>
Now that the code is entirely C++, remove all the various extern "C"
markers, except arount the ncclNetPlugin_v* structures.  This is
probably not entirely correct, as the functions themselves still
have C++ linkage, but on the NCCL side, they also don't force
C linkage for the forward declarations, and so we're already relying
on the fact that GNU and Clang compilers don't have a different
calling convention and only have different name mangling between
the two languages.

Signed-off-by: Brian Barrett <[email protected]>
No reason to have our own macros with their double-evaluation problems
when we can just use std::min and std::max.  Bonus, with C++14 or later,
we can find the max of more than 2 items in one call.

Signed-off-by: Brian Barrett <[email protected]>
One of the few places we should use templates, making math
functions easier to write.

Signed-off-by: Brian Barrett <[email protected]>
@bwbarrett bwbarrett force-pushed the feature/cppize-the-code branch from f172789 to f4817de Compare March 13, 2025 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants