Skip to content
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

[SYCL][NFC] Simplify working with mock images in unit tests #14816

Conversation

AlexeySachkov
Copy link
Contributor

Most of our unit-tests only care about getting a device image with certain kernels and certain properties regardless of how other fields are set.

This patch introduces a new constructor to UrImage to simplify unit-tests code. Also it cleans up some includes and uses existing helpers where possible to generate device images for tests.

Most of our unit-tests only care about getting a device image with
certain kernels and certain properties regardless of how other fields
are set.

This patch introduces a new constructor to UrImage to simplify
unit-tests code. Also it cleans up some includes and uses existing
helpers where possible to generate device images for tests.
@AlexeySachkov AlexeySachkov marked this pull request as draft October 10, 2024 11:17
@AlexeySachkov AlexeySachkov changed the title [SYCL][NFC] Improve work with mock images in unit tests [SYCL][NFC] Simplify working with mock images in unit tests Oct 11, 2024
@AlexeySachkov
Copy link
Contributor Author

Most recent update did not bring any new functionality, it was just a merge with sycl branch to adjust the PR to the codebase changes (namely removal of UrArray). I previously wanted for another PR to go first, but it was a long time ago and this one should be ready, so let's go with it first.

Once CI passes, I will proceed with commit here, assuming that the previous approval still stands (simply because there were no significant changes made during the merge)

@AlexeySachkov AlexeySachkov marked this pull request as ready for review October 11, 2024 12:19
@AlexeySachkov AlexeySachkov merged commit de5e4ee into intel:sycl Oct 11, 2024
12 checks passed
@AlexeySachkov AlexeySachkov deleted the private/asachkov/mock-image-constructors branch October 11, 2024 15:53
@sarnex
Copy link
Contributor

sarnex commented Oct 11, 2024

@AlexeySachkov Seeing some werror postcommit fails unfortunately

In file included from /__w/llvm/llvm/src/sycl/unittests/helpers/TestKernel.hpp:12:
/__w/llvm/llvm/src/sycl/unittests/helpers/UrImage.hpp:279:25: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move]
  279 |             "", "", {}, std::move(std::vector<unsigned char>{1, 2, 3, 4, 5}),
      |                         ^
/__w/llvm/llvm/src/sycl/unittests/helpers/UrImage.hpp:279:25: note: remove std::move call here
  279 |             "", "", {}, std::move(std::vector<unsigned char>{1, 2, 3, 4, 5}),
      |                         ^~~~~~~~~~                                         ~

@AlexeySachkov
Copy link
Contributor Author

@AlexeySachkov Seeing some werror postcommit fails unfortunately

In file included from /__w/llvm/llvm/src/sycl/unittests/helpers/TestKernel.hpp:12:
/__w/llvm/llvm/src/sycl/unittests/helpers/UrImage.hpp:279:25: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move]
  279 |             "", "", {}, std::move(std::vector<unsigned char>{1, 2, 3, 4, 5}),
      |                         ^
/__w/llvm/llvm/src/sycl/unittests/helpers/UrImage.hpp:279:25: note: remove std::move call here
  279 |             "", "", {}, std::move(std::vector<unsigned char>{1, 2, 3, 4, 5}),
      |                         ^~~~~~~~~~                                         ~

Looking into it

@AlexeySachkov
Copy link
Contributor Author

@AlexeySachkov Seeing some werror postcommit fails unfortunately

In file included from /__w/llvm/llvm/src/sycl/unittests/helpers/TestKernel.hpp:12:
/__w/llvm/llvm/src/sycl/unittests/helpers/UrImage.hpp:279:25: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move]
  279 |             "", "", {}, std::move(std::vector<unsigned char>{1, 2, 3, 4, 5}),
      |                         ^
/__w/llvm/llvm/src/sycl/unittests/helpers/UrImage.hpp:279:25: note: remove std::move call here
  279 |             "", "", {}, std::move(std::vector<unsigned char>{1, 2, 3, 4, 5}),
      |                         ^~~~~~~~~~                                         ~

Looking into it

#15675

I've re-configured my local build to use clang in order to see all those warnings. I don't think that passing -werror to configure.py did anything, because I still don't see any errors, but at least I don't see those warnings anymore with that patch

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