Skip to content

Conversation

AlexeySachkov
Copy link
Contributor

This PR fixes type name that is being printed as free function kernel argument type in its forward-declaration in the integration header.

Before the change, we used the original argument type name, which could be an alias - this patch makes use of the canonical type's name to make sure that all type aliases are "unwrapped".

This PR fixes type name that is being printed as free function kernel
argument type in its forward-declaration in the integration header.

Before the change, we used the original argument type name, which could
be an alias - this patch makes use of the canonical type's name to make
sure that all type aliases are "unwrapped".
template<typename T>
[[__sycl_detail__::add_ir_attributes_function("sycl-nd-range-kernel", 2)]]
void bar_using(ns::BarUsing<T> Arg) {}
template void bar_using(ns::BarUsing<int>);
Copy link
Contributor

@Fznamznon Fznamznon Sep 18, 2025

Choose a reason for hiding this comment

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

Does something like

class A {
    public:
    using B = int;
};

void freefu(A::B a) {

}

work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it works, I added it as a test case in e327133

@AlexeySachkov
Copy link
Contributor Author

Failures in compatibility test suite are unrelated: this PR only changes integration header generation for free function kernels, but neither of failed tests uses the feature:

Failed Tests (1):
  SYCL :: ESIMD/unified_memory_api/gather_acc_dg2_pvc_stateless.cpp
Failed Tests (1):
  SYCL :: Assert/assert_in_multiple_tus.cpp

I will proceed with merge

@AlexeySachkov AlexeySachkov merged commit 5d9a176 into intel:sycl Sep 22, 2025
26 of 28 checks passed
@AlexeySachkov AlexeySachkov deleted the private/asachkov/fix-using-type-aliases-as-free-function-kernel-args branch September 22, 2025 12:40
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.

2 participants