[CuTe] Add missing include for smem_ptr_flag_bits in print_tensor.hpp#3244
Open
LeSingh1 wants to merge 1 commit into
Open
[CuTe] Add missing include for smem_ptr_flag_bits in print_tensor.hpp#3244LeSingh1 wants to merge 1 commit into
LeSingh1 wants to merge 1 commit into
Conversation
cute/util/print_tensor.hpp references smem_ptr_flag_bits<B> at line 92 in its print_layout overload for ComposedLayout, but only includes config.hpp, layout.hpp, and tensor_impl.hpp -- none of which transitively pull in cute/pointer_flagged.hpp where smem_ptr_flag_bits is defined. In practice users typically reach this header via cute/tensor.hpp (which already pulls in pointer_flagged.hpp), so the bug only surfaces when the header is included directly. clangd and isolated translation units that include only print_tensor.hpp report "use of undeclared identifier 'smem_ptr_flag_bits'". Fixes NVIDIA#3205
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.
Summary
cute/util/print_tensor.hppreferencessmem_ptr_flag_bits<B>(line 92, in theprint_layoutoverload forComposedLayout), but its existing includes (config.hpp,layout.hpp,tensor_impl.hpp) do not transitively pull incute/pointer_flagged.hpp, which is the header that definessmem_ptr_flag_bits.In typical usage the header is reached via
cute/tensor.hpp, which already includespointer_flagged.hpp, so the bug is hidden. It surfaces when:cute/util/print_tensor.hppdirectly, orclangdparses the header in isolation (the symptom reported in [BUG] [CuTe] print_tensor.hpp missing include for cute/pointer_flagged.hpp #3205: "use of undeclared identifier 'smem_ptr_flag_bits'").This patch adds the missing include so the header is self-contained.
Fix
#include <cute/layout.hpp> +#include <cute/pointer_flagged.hpp> // cute::smem_ptr_flag_bits #include <cute/tensor_impl.hpp>Mirrors the include style already used in
cute/atom/mma_traits_sm90_gmma.hpp(#include <cute/pointer_flagged.hpp> // cute::smem_ptr_flag).Verification
config.hpp,layout.hpp,tensor_impl.hpptransitively includepointer_flagged.hpp.grep -rn "pointer_flagged" include/cute/shows onlytensor.hppandmma_traits_sm90_gmma.hpppulling it in elsewhere.Issue
Fixes #3205