Skip to content

[SYCL] Enable handler copy method for N to M dimensions. #697

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

Conversation

alexeyvoronov-intel
Copy link
Contributor

Enabled the handler copy method to use it for cases with
mismatched dimensions of accessors.

Signed-off-by: Alexey Voronov [email protected]

Copy link
Contributor

@keryell keryell left a comment

Choose a reason for hiding this comment

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

@alexeyvoronov-intel
Copy link
Contributor Author

@keryell
Copy link
Contributor

keryell commented Oct 29, 2019

And what about https://gitlab.khronos.org/sycl/Specification/issues/72 ? Is there an impact ?

@alexeyvoronov-intel
Copy link
Contributor Author

alexeyvoronov-intel commented Oct 30, 2019

And what about https://gitlab.khronos.org/sycl/Specification/issues/72 ? Is there an impact ?

Yes, but I think it can be handled when the specification issue is resolved.

>>> def sycl_id(id1,id2,id3,r1,r2,r3):
...     return id3 + (id2 * r3) + (id1 * r3 * r2)
...
>>> def opencl_id(id1,id2,id3,r1,r2,r3):
...     return id1 + (id2 * r1) + (id3 * r1 * r2)
...
>>> sycl_ids = []
>>> opencl_ids = []
>>> r1, r2, r3 = (2,2,2)
>>>
>>> for id1 in range(r1):
...     for id2 in range(r2):
...         for id3 in range(r3):
...             sycl_ids.append(sycl_id(id1,id2,id3,r1,r2,r3))
...             opencl_ids.append(opencl_id(id1,id2,id3,r1,r2,r3))
...
>>> print("SYCL", sycl_ids)
SYCL [0, 1, 2, 3, 4, 5, 6, 7]
>>> print("OpenCL", opencl_ids)
OpenCL [0, 4, 2, 6, 1, 5, 3, 7]

@alexeyvoronov-intel alexeyvoronov-intel force-pushed the private/avoronov/enable_copy_with_different_dimensions_case branch from 5542549 to abb7002 Compare November 1, 2019 14:07
@alexeyvoronov-intel alexeyvoronov-intel force-pushed the private/avoronov/enable_copy_with_different_dimensions_case branch from abb7002 to 5fbad68 Compare November 6, 2019 14:44
@keryell
Copy link
Contributor

keryell commented Nov 6, 2019

def sycl_id(id1,id2,id3,r1,r2,r3):
... return id3 + (id2 * r3) + (id1 * r3 * r2)

Is this PyCL/PSYCL/PySYCL/...? :-)

@keryell
Copy link
Contributor

keryell commented Nov 6, 2019

The problem I see for know is what is the semantics for it?
There is no documentation describing it, even not a comment in the implementation...

@alexeyvoronov-intel
Copy link
Contributor Author

def sycl_id(id1,id2,id3,r1,r2,r3):
... return id3 + (id2 * r3) + (id1 * r3 * r2)

Is this PyCL/PSYCL/PySYCL/...? :-)

It's just Python, I copied the formulas from https://gitlab.khronos.org/sycl/Specification/issues/72 , and played with them a little.

@alexeyvoronov-intel
Copy link
Contributor Author

The problem I see for know is what is the semantics for it?
There is no documentation describing it, even not a comment in the implementation...

I made this patch to unlock the update for CTS https://gitlab.khronos.org/sycl/Specification/issues/181.

I agree that there are many pitfalls that should be described in the specification. Will we impose the same restrictions as OpenCL or not. For example, code snippet of copying below and other more complex options:

accessor<char, 1, access::mode::read, access::target::constant> AccessorSrc(BufferSrc, Cgh, range<1>(400));
accessor<int32_t, 2, access::mode::write, access::target::global_buffer> AccessorDst(BufferDst, Cgh, range<2>(10));

Enabled the handler copy method to use it for cases with
mismatched dimensions of accessors.

Signed-off-by: Alexey Voronov <[email protected]>
@alexeyvoronov-intel alexeyvoronov-intel force-pushed the private/avoronov/enable_copy_with_different_dimensions_case branch from 5fbad68 to e793d8f Compare November 6, 2019 23:40
@bader bader requested a review from romanovvlad November 7, 2019 10:26
@romanovvlad romanovvlad merged commit ff30897 into intel:sycl Nov 8, 2019
@alexeyvoronov-intel alexeyvoronov-intel deleted the private/avoronov/enable_copy_with_different_dimensions_case branch November 11, 2019 16:27
vladimirlaz pushed a commit to vladimirlaz/llvm that referenced this pull request Jan 13, 2020
  CONFLICT (content): Merge conflict in llvm/lib/Support/Triple.cpp
  CONFLICT (content): Merge conflict in llvm/include/llvm/ADT/Triple.h
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