-
Notifications
You must be signed in to change notification settings - Fork 412
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
Add tests to ScopeGuard
#7028
Add tests to ScopeGuard
#7028
Conversation
Tests seem to fail for NVHPC 23.7 + CUDA 12.2. I could successfully execute them on NVHPC 24.5 + CUDA 12.2, however. Il will reproduce using the same Docker image as for the tests. I also had segfaults on exit tests and on death tests using a local install of NVHPC 23.11. Maybe the tests should not run for this compiler? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You want to static assert that the scope guard is not copyable?
static_assert(!std::is_copy_constructible<Kokkos::ScopeGuard>
&& !std::is_copy_assignable<Kokkos::ScopeGuard>);
(Add at namespace scope)
I think our convention is to suffix death tests with _DeathTest
.
I am not sure how to do it with fixtures though.
Look a bit what we did for other death tests. I think we generally remove them from the list with the OpenACC backend. |
This is a good idea, I will do it.
Do you mean to suffix the test suite name or the test name? The former is passed as a fixture class, but renamed to be meaningful in the outputs; so I can append |
But the OpenACC backend works fine on those death tests! It is the CUDA one with NVHPC which is faulty. This is weird, I should check what was done for the other death tests. |
NVC++ does not seem to like these new tests being added. The OPENMPTARGET and the NVHPC build failures are legit. |
Ok, I'll add some guards to prevent those tests to run with NVHPC. Yet, I'm surprised that NVHPC with the OpenACC backend works. |
It seems to work now for NVHPC. The only failing job is for HIP, which segfaults for a lot of tests. |
This PR aims to test the
Kokkos::ScopeGuard
class, that was untested.No new features nor modifications were added to the core source code. A new test file
core/unit_test/UnitTest_ScopeGuard.cpp
was created and tests the scope guard on various configurations. Especially, faulty situations were tested, e.g. when creating two scope guards.