Skip to content

[SYCL] Add support for templated call operator in functors #7970

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

Merged
merged 3 commits into from
Jan 13, 2023

Conversation

srividya-sundaram
Copy link
Contributor

@srividya-sundaram srividya-sundaram commented Jan 10, 2023

This PR enables kernels to be defined as named function object types, where the operator() member function is templated.

Example:

class FunctorWithCallOpTemplated {
  int x;
  public:
  template <int x = 0>
  void operator()() const {}
};

q.submit([&](sycl::handler &cgh) {
    cgh.single_task(FunctorWithCallOpTemplated{});
  });

@srividya-sundaram srividya-sundaram temporarily deployed to aws January 10, 2023 07:36 — with GitHub Actions Inactive
@srividya-sundaram srividya-sundaram marked this pull request as ready for review January 10, 2023 22:14
@srividya-sundaram srividya-sundaram requested a review from a team as a code owner January 10, 2023 22:14
@srividya-sundaram srividya-sundaram changed the title [WIP] [SYCL] Add support for templated call operator in functors [SYCL] Add support for templated call operator in functors Jan 10, 2023
Copy link
Contributor

@premanandrao premanandrao left a comment

Choose a reason for hiding this comment

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

LGTM

@srividya-sundaram srividya-sundaram temporarily deployed to aws January 11, 2023 18:24 — with GitHub Actions Inactive
@srividya-sundaram
Copy link
Contributor Author

@intel/llvm-gatekeepers Hi, this is ready for merge. Thank you.

@srividya-sundaram
Copy link
Contributor Author

Hi @tfzhu @yinyangsx
The SYCL / Linux / Build + LIT job has been waiting forever to be picked up from the queue. I haven't seen them take this long.
Can you please take a look? Thank you!

@tfzhu
Copy link
Contributor

tfzhu commented Jan 12, 2023

Hi @tfzhu @yinyangsx The SYCL / Linux / Build + LIT job has been waiting forever to be picked up from the queue. I haven't seen them take this long. Can you please take a look? Thank you!

2 Linux runners are offline. Fixed and task should be started later

@srividya-sundaram srividya-sundaram temporarily deployed to aws January 12, 2023 08:01 — with GitHub Actions Inactive
@srividya-sundaram srividya-sundaram temporarily deployed to aws January 12, 2023 13:49 — with GitHub Actions Inactive
@srividya-sundaram
Copy link
Contributor Author

@tfzhu I can't tell what's wrong with SYCL / Linux / [AWS] CUDA LLVM Test Suite (pull_request_target) by looking at the log.
Can you please comment if you are aware of what's going on?

@againull againull merged commit 11f53ad into intel:sycl Jan 13, 2023
srividya-sundaram added a commit to srividya-sundaram/llvm that referenced this pull request Jan 18, 2023
bader pushed a commit that referenced this pull request Jan 19, 2023
…nctors without call operators (#8047)

This PR reverts the support for templated call operators in functors and
functors without call operators which were introduced in #7104 and #7970

We found a regression internally with
#7104 that
#7970 attempted to fix. A subsequent
review of #7970 internally, lead to
identifying some pre-existing caveats with regards to supporting
templated call operators in functor, supporting cases where there are
multiple call operators in functor and making sure the right
instantiated version is selected etc.

In order to better address the pre-existing issues as well as gaps in
#7970 , it was decided to revert the above two
PRs.
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.

5 participants