-
Notifications
You must be signed in to change notification settings - Fork 761
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
max with conflicting types #178
Comments
Would a cast solve the issue ? e.g. |
Yes, a cast would work. Maybe specifying the template type is a little more
common for this type of situation: max<unsigned>(...)
…On Mon, Feb 11, 2019 at 6:33 PM Sylvain Jeaugey ***@***.***> wrote:
Would a cast solve the issue ? e.g. (uint32_t)coll.args.nThreads ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#178 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AHLOjgeUhEXkwWSM_t4aitpXGykPS8qYks5vMamDgaJpZM4a0ZaZ>
.
|
Actually, these kind of issues tend to happen frequently, so I was considering replacing all std::min and std::max by macros :
Do you see an advantage of using std:: functions instead of those trivial macros ? |
I'm fine with either approach, I don't see any real drawback of macros
here, as long as they are not part of the public header. If anything, you
might have to be careful to not include windows.h without defining
NO_MIN_MAX.
I have to admit that I'm not used to NCCL's code style, so you should go
with your preference, not mine.
Thanks for the quick response!
…On Mon, Feb 11, 2019, 18:58 Sylvain Jeaugey ***@***.*** wrote:
Actually, these kind of issued tend to happen frequently, so I was
considering replacing all std::min and std::max by macros :
#define MIN(a, b) ((a)<(b) ? (a) : (b))
#define MAX(a, b) ((a)>(b) ? (a) : (b))
Do you see an advantage of using std:: functions instead of those trivial
macros ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#178 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AHLOjkf5sVsd8hxucgi9jIKR4jq6wqHIks5vMa81gaJpZM4a0ZaZ>
.
|
Actually those macros would evaluate the selected expression twice. I guess that's the main problem with that approach since it could cause weird bugs. For example, |
Fixes for this issue have been made to NCCL 2.4.6. Please re-open if the issue is not resolved. |
Compiling gives an error 'deduced conflicting types for parameter '_Tp' ('unsigned int' vs. 'unsigned short')' at
nccl/src/enqueue.cu
Line 368 in 1450d42
The text was updated successfully, but these errors were encountered: