Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

[SYCL] Update part of the tests to make double support optional #1190

Merged
merged 3 commits into from
Sep 12, 2022

Conversation

romanovvlad
Copy link

No description provided.

@romanovvlad romanovvlad marked this pull request as ready for review August 31, 2022 12:27
@romanovvlad romanovvlad requested review from a team as code owners August 31, 2022 12:27
@v-klochkov
Copy link

Looks good to me, but isn't this fix a subset of a bigger fix (#1150) being reviewed and waiting for approval?

@romanovvlad
Copy link
Author

Looks good to me, but isn't this fix a subset of a bigger fix (#1150) being reviewed and waiting for approval?

That's right. This patch suggests an alternative solution. It covers only part of the tests to demonstrate approach.

@kbobrovs
Copy link

kbobrovs commented Sep 1, 2022

if (device.has(sycl::aspect::fp64)-based approach can be risky. Tests may be reported as PASSED not really running double test cases, so I'd rather separate out tests using double and have them reported as UNSUPPORTED. On the other hand, we don't want to have code duplication. So what we could do is to create pairs of tests:

test.cpp:

// to avoid running same test cases in test.cpp and test_double.cpp
// REQUIRES: !sycl-aspect-fp64
...
int_test_case();
float_test_case();
#ifdef USE_FP64
  fp64_test_case();
#endif
...

test_double.cpp

// REQUIRES: sycl-aspect-fp64
#define USE_FP64
#include "test.cpp"

in this case either test.cpp or test_double.cpp will be reported as "UNSUPPORTED" depending on fp64 support by the test platform.

@romanovvlad
Copy link
Author

if (device.has(sycl::aspect::fp64)-based approach can be risky. Tests may be reported as PASSED not really running double test cases, so I'd rather separate out tests using double and have them reported as UNSUPPORTED.

Not sure that not testing doubles but having "UNSUPPORTED" tests is a way better than not testing doubles and reporting "PASSED"(we could also add a message from the test saying that doubles are skipped).

We already have similar cases in the code base: fp16, image, atomic64, ext_oneapi_cuda_async_barrier. So, if we go with LIT features way (// REQUIRES: sycl-aspect-fp64) we would need to do similar LIT features for all tests that require some device feature.

Also, I'm not really sure how we can implement that. Let's say we are going to test cuda be, l0 gpu, opencl gpu, opencl cpu and one target from this list(opencl cpu) doesn't support a feature, should we run a test for all targets or we should skip the test completely?

@AlexeySachkov
Copy link

if (device.has(sycl::aspect::fp64)-based approach can be risky. Tests may be reported as PASSED not really running double test cases, so I'd rather separate out tests using double and have them reported as UNSUPPORTED.

Also, I'm not really sure how we can implement that. Let's say we are going to test cuda be, l0 gpu, opencl gpu, opencl cpu and one target from this list(opencl cpu) doesn't support a feature, should we run a test for all targets or we should skip the test completely?

I agree with @romanovvlad here: list of supported aspects is a property of a device and we can have more than one device available on our systems. I suggest that we go with the approach Vlad implemented in this PR, because it should save us more machine time during testing. Moreover, when optional kernel features will be implemented, we should be able to remove per-kernel device code split from all tests.

@romanovvlad romanovvlad merged commit 720e857 into intel:intel Sep 12, 2022
myler pushed a commit to myler/llvm-test-suite that referenced this pull request Mar 22, 2023
aelovikov-intel pushed a commit to aelovikov-intel/llvm that referenced this pull request Mar 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants