Repository navigation
Conversation
…e, as filtered_lrelu.cpp uses "if constexpr" which is c++17, and will otherwise fail with the following error. filtered_lrelu.cpp(147): error C4984: 'if constexpr' is a C++17 language extension
Author
|
If you don't wish to adopt this flag, you might alternatively consider removing "if constexpr" for greater portability. |
|
I just tested this on Ubuntu 20.04 and it works, so the flag could be added in general to benefit Windows users. |
PDillis
referenced
this pull request
in PDillis/stylegan3-fun
Nov 23, 2021
… in discriminator_synthesis.py
|
Actually, I just tested it again with another code (random interpolation in particular), and it fails. I recommend adding a os check as follows: def _init():
global _plugin
# Bob Burrough's PR (#45) so that the plugins work in Windows: https://github.com/NVlabs/stylegan3/pull/45
extras = {}
if os.name == 'nt':
extras['extra_cflags'] = ['/std:c++17']
if _plugin is None:
_plugin = custom_ops.get_plugin(
module_name='filtered_lrelu_plugin',
sources=['filtered_lrelu.cpp', 'filtered_lrelu_wr.cu', 'filtered_lrelu_rd.cu', 'filtered_lrelu_ns.cu'],
headers=['filtered_lrelu.h', 'filtered_lrelu.cu'],
source_dir=os.path.dirname(__file__),
extra_cuda_cflags=['--use_fast_math'],
**extras,
)
return True |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
filtered_lrelu.cpp uses "if constexpr" which is c++17, and will otherwise fail with the following error.
filtered_lrelu.cpp(147): error C4984: 'if constexpr' is a C++17 language extension
Please note, I have not tested this on other platforms (e.g. Ubuntu), where this flag might be inappropriate.