Skip to content

[SYCL] Image_accessor read with sampler for host device. #597

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
Sep 19, 2019

Conversation

garimagu
Copy link
Contributor

@garimagu garimagu commented Sep 4, 2019

-Support added for sampler with NEAREST Filtering Mode.
-Check if the results are consistent with the values read by CPU/GPU
 device using a test case.
-Currently, the test case is enabled only for CPU. Seg faults on GPU.
-Added a small test case for as() function in vec class. There is no
 efficient test case in CTS or in lit-tests.

Signed-off-by: Garima Gupta <[email protected]>

NOTE: PLEASE REVIEW ONLY THE LAST COMMIT.
THE FIRST 2 COMMITS ARE A PART OF REVIEW: #562

@@ -589,7 +589,8 @@ template <typename Type, int NumElements> class vec {
static constexpr size_t get_count() { return NumElements; }
static constexpr size_t get_size() { return sizeof(m_Data); }

template <typename convertT, rounding_mode roundingMode>
template <typename convertT,
rounding_mode roundingMode = rounding_mode::automatic>
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd like that too but it's not spec. Propose to clarify whether it is possible to do so.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In table 4.98 the spec says:
automatic - Default rounding mode for the SYCL vec class element type, rtz (round toward zero) for integer types and rte(roundtonearesteven)forfloating-point types.
Is it not clear enough in the spec?

Copy link
Contributor

@alexeyvoronov-intel alexeyvoronov-intel Sep 16, 2019

Choose a reason for hiding this comment

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

Yes, that explains what automatic means for floating point types and for integer types. What behavior is expected.

But you change the API which is described in the specification.

I don't think it's a bad change. But if a user writes code with our SYCL, and uses what you wrote(cl::sycl::int4::template convert()), then his code may not be compiled with another SYCL that follows the specification.

template <typename convertT, rounding_mode roundingMode>
vec<convertT, numElements> convert() const;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is a good point. Do you think asking for a spec update is valid for this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I agree with this change in SYCL specification. In OpenCL when converting by default, a rounding model is not written.

@garimagu garimagu force-pushed the private/garimagu/readAPI_sampler2 branch from 2ef9b66 to 0842fdf Compare September 16, 2019 17:30
@garimagu
Copy link
Contributor Author

Please only check the last 2 commits. The previous commits are being reviewed in another PR.

care of conversion rules as per OpenCL spec 1.2 section 8.3.
Addition of image_accessor_write_api.cpp test case.

Signed-off-by: Garima Gupta <[email protected]>
Addition of test case for read API without a sampler.
Checking is done if the read data is correct and as expected.

Signed-off-by: Garima Gupta <[email protected]>
-Support added for sampler with NEAREST Filtering Mode.
-Check if the results are consistent with the values read by CPU/GPU
 device using a test case.
-Currently, the test case is enabled only for CPU. Seg faults on GPU.
-Added a small test case for as() function in vec class. There is no
 efficient test case in CTS or in lit-tests.

Signed-off-by: Garima Gupta <[email protected]>
@garimagu
Copy link
Contributor Author

Rebased, squashed the last commit, did change in the test to rectify the failure seen on Windows.

@garimagu
Copy link
Contributor Author

Please check only the last commit: [SYCL] Image_accessor read with sampler for host device.

@bader bader merged commit 98d9382 into intel:sycl Sep 19, 2019
aelovikov-intel pushed a commit to aelovikov-intel/llvm that referenced this pull request Feb 23, 2023
The test must return a value larger than zero if an error occurs.
The expected warning from the runtime has been actualized.

Signed-off-by: Pavel Samolysov <[email protected]>
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