Skip to content

[SYCL] Add an user-defined copy constructor #11637

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 2 commits into from
Oct 24, 2023

Conversation

eunakim0103
Copy link
Contributor

@eunakim0103 eunakim0103 commented Oct 24, 2023

The static verifier reported a missing user defined copy constructor as delete to match to the existing assignment operator.

@eunakim0103 eunakim0103 requested a review from a team as a code owner October 24, 2023 05:49
@eunakim0103 eunakim0103 requested a review from bso-intel October 24, 2023 05:49
@eunakim0103 eunakim0103 marked this pull request as draft October 24, 2023 05:49
@eunakim0103 eunakim0103 temporarily deployed to WindowsCILock October 24, 2023 05:51 — with GitHub Actions Inactive
@eunakim0103 eunakim0103 temporarily deployed to WindowsCILock October 24, 2023 06:13 — with GitHub Actions Inactive
@eunakim0103 eunakim0103 marked this pull request as ready for review October 24, 2023 13:54
@againull
Copy link
Contributor

Can we =delete copy constructor as well, instead of adding both assignment and copy?

@againull
Copy link
Contributor

againull commented Oct 24, 2023

And probably we should cover all related cases from here https://github.com/intel/llvm/pull/10452/files in one PR.

@eunakim0103
Copy link
Contributor Author

Can we =delete copy constructor as well, instead of adding both assignment and copy?

We could. "delete" or "default". I thought it would be better to have default constructor and assignment operator then deleting them. @againull, do you prefer to delete?

@againull
Copy link
Contributor

Can we =delete copy constructor as well, instead of adding both assignment and copy?

We could. "delete" or "default". I thought it would be better to have default constructor and assignment operator then deleting them. @againull, do you prefer to delete?

Considering the discussion in PR #10452 I believe "delete" is preferrable.

@eunakim0103
Copy link
Contributor Author

Can we =delete copy constructor as well, instead of adding both assignment and copy?

We could. "delete" or "default". I thought it would be better to have default constructor and assignment operator then deleting them. @againull, do you prefer to delete?

Considering the discussion in PR #10452 I believe "delete" is preferrable.

We can leave the assignment operator (=) as "delete". The static verifier tool reported missing copy constructor with PR #10452 fix and we need to add a copy constructor.

To clear, which one do you do think it would be better?

  1. copy & = both "delete"
  2. copy & = both "default"
  3. ="default" or "delete" & no copy constructor <-- this was reported as missing a copy constructor

@eunakim0103
Copy link
Contributor Author

The two copy-assignment operators that were "delete" have been changed to "default"
in #10886

Here's the description in PR.

As part of version two of sycl_ext_oneapi_sub_group_mask the copy-assignment operator is defined as default but were deleted as part of #10564. This changes them to default ahead of version 2 of the extension to avoid regressions.

I thought it would be good have default copy = rather than delete them.

@againull
Copy link
Contributor

The two copy-assignment operators that were "delete" have been changed to "default" in #10886

Here's the description in PR.

As part of version two of sycl_ext_oneapi_sub_group_mask the copy-assignment operator is defined as default but were deleted as part of #10564. This changes them to default ahead of version 2 of the extension to avoid regressions.

I thought it would be good have default copy = rather than delete them.

So, why operator= was deleted for classes in https://github.com/intel/llvm/pull/10452/files? I am proposing to apply same logic here and do:

  1. copy & = both "delete"

@eunakim0103
Copy link
Contributor Author

The two copy-assignment operators that were "delete" have been changed to "default" in #10886
Here's the description in PR.

As part of version two of sycl_ext_oneapi_sub_group_mask the copy-assignment operator is defined as default but were deleted as part of #10564. This changes them to default ahead of version 2 of the extension to avoid regressions.

I thought it would be good have default copy = rather than delete them.

So, why operator= was deleted for classes in https://github.com/intel/llvm/pull/10452/files? I am proposing to apply same logic here and do:

  1. copy & = both "delete"

Yes, we can do that. Will fix both. Thanks!

@eunakim0103 eunakim0103 temporarily deployed to WindowsCILock October 24, 2023 18:51 — with GitHub Actions Inactive
@eunakim0103 eunakim0103 changed the title [SYCL] Add an user-defined copy constructor and change the assignment operator to default [SYCL] Add an user-defined copy constructor Oct 24, 2023
@eunakim0103 eunakim0103 temporarily deployed to WindowsCILock October 24, 2023 19:52 — with GitHub Actions Inactive
@againull againull merged commit 9da6668 into intel:sycl Oct 24, 2023
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.

3 participants