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

Fix building under NVIDIA's CUDA compiler #875

Merged
merged 1 commit into from
Sep 21, 2018

Conversation

CandyGumdrop
Copy link
Contributor

The issue #742 seems to also affect other compilers using the EDG C++ Front End, such as the NVIDIA CUDA compiler.

nvcc from CUDA 9.2 gives the following error for me when including fmt 5.2.0 in a CUDA source file built with -std=c++14:

/usr/include/fmt/format.h(3677): error: a literal operator template must have a template parameter list equivalent to "<char ...>"

This patch fixes the issue by also disabling FMT_UDL_TEMPLATE when built under nvcc.

- Disable templated user-defined literals when compiled under nvcc

Similarly to Intel's C++ compiler, nvcc fails to compile templated UDLs
as they both share the same parsing engine (EDG C++ Front End).  This
fixes building CUDA programs which make use of fmt.
@vitaut vitaut merged commit 9d8021f into fmtlib:master Sep 21, 2018
@vitaut
Copy link
Contributor

vitaut commented Sep 21, 2018

Thanks!

@vitaut
Copy link
Contributor

vitaut commented Aug 11, 2019

@CandyGumdrop, could you please review the updated CONTIBUTING document, particularly the part about licensing, and let me know if you agree with it being applied to your contributions to {fmt}? The library is likely to be relicensed (#1073) so I'm collecting approval from all earlier contributors. Thanks!

@CandyGumdrop
Copy link
Contributor Author

@vitaut I agree with this change in licence.

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.

2 participants