USM testing rework for better USM support #298
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This is a small rework of the USM testing framework to make it easier to add new USM memory types in the future, and also adds shared USM support to many tests.
Reason for change
USM shared memory testing was lacking, this improves it by adding USM testing to most tests that currently do both device and host tests. It also removes duplication in the test suite itself.
Description of change
This change brings a lot of duplicated code into
cl_intel_unified_shared_memory_Test
(the base class of many tests). Specifically, it provides properties to check host and shared memory USM support, and helper functions to generate USM pointers.One of the design changes was adding a way to iterate through all available USM pointer types without having to copy-paste code. This is used to add shared allocations to many places alongside device and host allocations.
This results in the tests doing more work, but this only causes a 10% reduction in the time taken for testing, which is about 300ms on my system.
Anything else we should know?
N/A
Checklist
recent version available through
pip
) on all modified code.