Skip to content

Add pattern lifetime tests for clEnqueueFillBuffer and clEnqueueSVMMemFill#2677

Open
joselopeqti wants to merge 2 commits intoKhronosGroup:mainfrom
joselopeqti:fill_buffer_freed_pattern_coverage
Open

Add pattern lifetime tests for clEnqueueFillBuffer and clEnqueueSVMMemFill#2677
joselopeqti wants to merge 2 commits intoKhronosGroup:mainfrom
joselopeqti:fill_buffer_freed_pattern_coverage

Conversation

@joselopeqti
Copy link
Copy Markdown
Collaborator

Adds tests that modify the pattern used before the fill command is executed.

Adds coverage for clEnqueueFillBuffer and clEnqueueSVMMemFill:

The memory associated with pattern can be reused or freed after the function returns.

Comment on lines +810 to +814
if (host_buffer) free(host_buffer);
if (pattern) free(pattern);
if (fill_event) clReleaseEvent(fill_event);
if (user_event) clReleaseEvent(user_event);
if (buffer) clReleaseMemObject(buffer);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we use the RAII wrappers and either std::vectors or smart pointers in these tests so we don't need to clean this up manually?

Comment on lines +464 to +467
if (fill_event) clReleaseEvent(fill_event);
if (user_event) clReleaseEvent(user_event);
if (pattern) free(pattern);
if (svm_ptr) clSVMFree(context, svm_ptr);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same comment here - can we use wrappers so we don't need to do this cleanup manually?

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.

2 participants