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 invalid _CCCL_CUDACC definition for clang cuda #1656

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

miscco
Copy link
Collaborator

@miscco miscco commented Apr 22, 2024

clang-cuda does not implement the __CUDACC_VER_MAJOR__ macros

Consequently the currently the _CCCL_CUDACC_VER was 0 which made clang-cuda fail all our _CCCL_CUDACC_BELOW_MEOW checks.

We can fix this by synthesizing the information from CUDA_VERSION

@miscco miscco requested review from a team as code owners April 22, 2024 06:47
@miscco miscco added libcu++ For all items related to libcu++ infrastructure Shared CMake, github, etc infrastructure bug: functional labels Apr 22, 2024
@@ -685,7 +685,7 @@ __constexpr_isfinite(_A1 __lcpp_x) noexcept
return isfinite(__lcpp_x);
}

#if defined(_MSC_VER) || defined(__CUDACC_RTC__) || defined(_CCCL_CUDA_COMPILER_CLANG)
#if defined(_CCCL_COMPILER_MSVC) || defined(_CCCL_COMPILER_NVRTC)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just in case it was an oversight: This change removed || defined(_CCCL_CUDA_COMPILER_CLANG), but in further changes below, you left it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct. For whatever reason ptxas does not find the function definitions of logb and scalbn if we use the builtin

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ptxas fatal   : Unresolved extern function 'scalbn'
clang: error: ptxas command failed with exit code 255 (use -v to see invocation)
Ubuntu clang version 16.0.6 (++20231112100510+7cbf1a259152-1~exp1~20231112100554.106)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang: note: diagnostic msg: 
********************

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, thx for confirming!

@@ -17,7 +17,9 @@

// check that binder typedefs exit

// #include <cuda/std/functional>
#define _LIBCUDACXX_DISABLE_DEPRECATION_WARNINGS
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: To assist future maintenance, add a comment saying what deprecated APIs this is suppressing.

Or better yet, use a more fine-grained self-documenting warning suppression if it exists (e.g. _LIBCUDACXX_IGNORE_DEPRECATED_[SOME_API]), but this is probably beyond the scope of this PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am strongly in favor of adding more fine grained espace hatches, but we do not have them yet.

Given that everything we deprecated is because of the standard deprecating things, I would not want to add something here, but change it to a fine grained control soon^TM

@miscco miscco merged commit e3d181f into NVIDIA:main Apr 23, 2024
595 checks passed
@miscco miscco deleted the fix_clang_cuda branch April 23, 2024 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: functional infrastructure Shared CMake, github, etc infrastructure libcu++ For all items related to libcu++
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants