Skip to content

Avoid false-positive dependent name lookup error by not depending on auto keyword#12483

Merged
cloudhan merged 3 commits intomasterfrom
guangyunhan/fix-rocm-build
Aug 8, 2022
Merged

Avoid false-positive dependent name lookup error by not depending on auto keyword#12483
cloudhan merged 3 commits intomasterfrom
guangyunhan/fix-rocm-build

Conversation

@cloudhan
Copy link
Contributor

@cloudhan cloudhan commented Aug 5, 2022

Description:
Fix dependent name lookup in class template to access templated method.

Motivation and Context

  • Why is this change required? What problem does it solve?
    C++ grammar enforcement.

@cloudhan cloudhan requested a review from wejoncy August 5, 2022 05:38
@cloudhan

This comment was marked as resolved.

@cloudhan cloudhan requested a review from Lafi7e August 5, 2022 05:40
Lafi7e
Lafi7e previously approved these changes Aug 5, 2022
num_roi_cols,
reinterpret_cast<typename ToCudaType<T>::MappedType*>(Y.MutableData<T>()),
reinterpret_cast<typename ToCudaType<T>::MappedType*>(Y.template MutableData<T>()),
this->mode_ == RoiAlignMode::avg,
Copy link
Contributor

@skottmckay skottmckay Aug 5, 2022

Choose a reason for hiding this comment

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

Is there a build issue where this is required?

If not, please do not add unnecessary 'template ' qualifiers as they add unnecessary noise to the code. They should only be needed if the 'Tensor' type is one of the templatized types (in this case if T == Tensor and Y was of type T you would need it).

You're fetching a Tensor from the context right? If the rocm build is complaining do we need to specify Tensor& for Y instead of auto?

However, line 50 calls X_ptr->Data and you haven't updated that so it's not clear why Y.MutableData is an issue but X_ptr->Data is not.

ROCm's hip clang complaints that "use 'template' keyword to treat 'Foo' as a dependent template name"
where Foo is not a dependent template name. Instead, avoid the using of auto keyword fixes the error
here.
@cloudhan cloudhan changed the title Fix dependent name lookup Avoid false-positive dependent name lookup error by not depending on auto keyword Aug 5, 2022
@cloudhan cloudhan requested a review from skottmckay August 5, 2022 07:38
@cloudhan
Copy link
Contributor Author

cloudhan commented Aug 5, 2022

@wejoncy Not your fault. clang to be blamed.

@cloudhan cloudhan merged commit ddea1e4 into master Aug 8, 2022
@cloudhan cloudhan deleted the guangyunhan/fix-rocm-build branch August 8, 2022 02:32
@illsilin illsilin mentioned this pull request Aug 11, 2022
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.

4 participants