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

USM testing rework for better USM support #298

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

RossBrunton
Copy link
Contributor

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

  • Read and follow the project Code of Conduct.
  • Make sure the project builds successfully with your changes.
  • Run relevant testing locally to avoid regressions.
  • Run clang-format-16 (the most
    recent version available through pip) on all modified code.

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.
@RossBrunton RossBrunton merged commit 9a111ee into uxlfoundation:main Jan 23, 2024
3 checks passed
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