Repository navigation
Only define the __PRETTY_FUNCTION__ fallback on MSVC - #57
Merged
iwald-nvidia merged 1 commit intoNov 2, 2026
Merged
Conversation
GCC and Clang provide __PRETTY_FUNCTION__ as a predefined identifier, not a macro, so the #ifndef guard was always true and every file that included cuBQL had __PRETTY_FUNCTION__ replaced by __FUNCTION__. That dropped the signature from the string and broke headers that parse it, such as CCCL's cuda::std typeid when <cuda/memory_pool> is included after cuBQL. Restrict the fallback to MSVC (excluding clang-cl, which has the builtin) and map it to __FUNCSIG__, the MSVC equivalent. Fixes NVIDIA#56 Signed-off-by: Juan Jose Casafranca <juan@scenix.ai>
Collaborator
|
thank you! going to merge the moment CI is done. I'll also need to check that in barney and a few other projects as well then :-) |
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.
Fixes #56.
GCC and Clang provide
__PRETTY_FUNCTION__as a predefined identifier, not a macro, so the#ifndef __PRETTY_FUNCTION__guard incuBQL/math/common.hwas always true and redefined it as__FUNCTION__in every translation unit that included cuBQL.The fallback now only applies to MSVC (excluding clang-cl, which has the builtin), and maps to
__FUNCSIG__, MSVC's equivalent. The unreachabledefined(__func__)branch is gone, since__func__is not a macro on any compiler either.Tested on Linux:
f<int>()repro from math/common.h redefines __PRETTY_FUNCTION__ on GCC and Clang #56 printsvoid f() [with T = int]with GCC 13.3 and nvcc 13.0, andvoid f() [T = int]with Clang 18.1 (before:f).#include <cuda/memory_pool>after<cuBQL/bvh.h>with CCCL 3.2 andg++ -std=c++20now compiles; before, it failed with thetypeid.h/string_view.herrors from the issue.Not tested on MSVC.