Skip to content

[ESIMD] Allow constructing simd_view from simd #4514

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 8 commits into from
Nov 2, 2021

Conversation

DenisBakhvalov
Copy link
Contributor

The patch allows the following code to work:

  simd<int, 16> s = 0;
  simd_view v = s;

I added default template parameter for simd_view_impl class
and put it as a last template argument.

The patch allows the following code to work:
```
  simd<int, 16> s = 0;
  simd_view v = s;
```

I added default template parameter for simd_view_impl class
and put it as a last template argument.
@DenisBakhvalov
Copy link
Contributor Author

The corresponding E2E test is here: intel/llvm-test-suite#454

kychendev
kychendev previously approved these changes Sep 16, 2021
@bader bader requested a review from kbobrovs September 17, 2021 08:36
@@ -69,6 +69,19 @@ SYCL_ESIMD_FUNCTION void test_simd_view_copy_ctor() {
auto v0_view_copy(v0_view);
}

// test construction from vector.
SYCL_ESIMD_FUNCTION void test_simd_view_from_vector() {
simd<int, 16> s = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

please a test case for length 1

Copy link
Contributor

Choose a reason for hiding this comment

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

Added here: 33eede7

@bader bader requested a review from kbobrovs September 20, 2021 12:06
@kbobrovs
Copy link
Contributor

@DenisBakhvalov, could you please hold this until this big one is merged #4230 ?

@kbobrovs
Copy link
Contributor

@DenisBakhvalov, #4230 merged, please resolve conflicts then

@bader
Copy link
Contributor

bader commented Oct 5, 2021

@kbobrovs, @kychendev, @sndmitriev, do you need someone else to resolve merge conflicts?

@bader
Copy link
Contributor

bader commented Oct 18, 2021

@kbobrovs, @kychendev, @sndmitriev, do you need someone else to resolve merge conflicts?

Ping.

@kbobrovs
Copy link
Contributor

@kbobrovs, @kychendev, @sndmitriev, do you need someone else to resolve merge conflicts?

Ping.

@bader, sorry for delay. I resolved the conflicts, let's see the testing results.

@@ -70,6 +72,9 @@ class simd_view : public detail::simd_view_impl<BaseTy, RegionTy> {
simd_view(const simd_view &Other) = default;
simd_view(simd_view &&Other) = default;

// Construct a complete view of a vector
simd_view(BaseTy &Base) : BaseClass(Base) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please convert this to a documentation comment, and mention that this does not work for VL=1

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks. Is VL != 1 limitation still in effect? If so the best way would be to use SFINAE to disable this constructor in this case.

Copy link
Contributor

Choose a reason for hiding this comment

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

I added constructor to scalar specialization. So, VL=1 case works. See this commit: 33eede7

@kbobrovs kbobrovs merged commit 89b19c0 into intel:sycl Nov 2, 2021
v-klochkov added a commit to DenisBakhvalov/llvm-test-suite that referenced this pull request Dec 17, 2021
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