Skip to content

Conversation

@shajder
Copy link
Contributor

@shajder shajder commented Dec 5, 2025

Fixes #2372 according to issue description

…ERLAP when source and destination SVM ranges overlap
Copy link
Contributor

@bashbaug bashbaug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you considered testing all three scenarios in one test instead?

This would let us reuse the same context / command queue / etc, even the same SVM allocation if we choose, which means the tests will run faster and the code will be shorter.

Comment on lines 45 to 46
char *data_buf =
(char *)clSVMAlloc(contextWrapper, CL_MEM_READ_WRITE, dataSize * 2, 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend using the clSVMWrapper here instead, which automatically handles freeing the SVM allocation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 47 to 52
if (!data_buf)
{
log_error(
"svm_negative_dst_overlap_src: invalid result for clSVMAlloc\n");
return TEST_FAIL;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider:

Suggested change
if (!data_buf)
{
log_error(
"svm_negative_dst_overlap_src: invalid result for clSVMAlloc\n");
return TEST_FAIL;
}
test_assert_error(data_buf != nullptr, "clSVMAlloc failed");

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@shajder
Copy link
Contributor Author

shajder commented Dec 16, 2025

Have you considered testing all three scenarios in one test instead?

Corrected

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.

add a negative test for an overlapping clEnqueueSVMMemcpy

2 participants