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

Refactor buffer ReadWrite and Copy tests #2259

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MichaelRizkalla-arm
Copy link
Contributor

This change refactors the following tests to use RAII to clean-up allocated resources on exit, and adds additional changes as mentioned below:

  • test_arrayreadwrite
    • Allow different cl_mem_flags to be passed to the test.
  • test_bufferreadwriterect:
    • Allow different cl_mem_flags to be passed to the test.
    • Customisable copy, read and write functions.
  • test_buffer_copy
    • Fill the destination buffer with invalid_ptr instead of out_ptr if created with CL_MEM_(USE/COPY)_HOST_PTR.
  • test_buffer_partial_copy
    • Fill the destination buffer with invalid_ptr instead of out_ptr if created with CL_MEM_(USE/COPY)_HOST_PTR.

Allow bufferreadwriterect test to use a customisable read, write and
copy test functions.

Signed-off-by: Michael Rizkalla <[email protected]>
This change uses RAII to manage object lifetimes to ensure objects'
destruction if an error occurred in the test.
Additionally, modify `test_arrayreadwrite` to pass a custom memory flag
to the test function.

Signed-off-by: Michael Rizkalla <[email protected]>
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.

1 participant