Skip to content

fix: Strip host-write-only flag and cover all capture-replay allocations - #486

Merged
bashbaug merged 1 commit into
intel:mainfrom
TaoSc:upstream-capture-fix
Sep 7, 2026
Merged

bashbaug merged 1 commit into
intel:mainfrom
TaoSc:upstream-capture-fix

Conversation

@TaoSc

@TaoSc TaoSc commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • CaptureReplay needs to read back buffer/image contents on the host to dump and replay kernels, so CL_MEM_HOST_WRITE_ONLY must be cleared in addition to CL_MEM_HOST_NO_ACCESS.
  • Extends this flag masking (previously only applied in clCreateBuffer) to clCreateBufferWithProperties, clCreateImage, and clCreateImageWithProperties which were previously missing it.

Fixes

CLUMD's internal sanity test copybuf_test wasn't being replayed properly as the capture was missing source data.

Testing Done

  • Built and linked successfully for Windows x64
  • Captured a workload using clCreateBuffer and verified replay works with host-write-only/device-only flags set
  • Captured a workload using clCreateBufferWithProperties and verified replay works with host-write-only/device-only flags set
  • Captured a workload using clCreateImage and verified replay works with host-write-only/device-only flags set
  • Captured a workload using clCreateImageWithProperties and verified replay works with host-write-only/device-only flags set

Capture/replay needs to read buffer and image contents back on the host
to dump and replay kernels, so CL_MEM_HOST_WRITE_ONLY must be cleared
alongside CL_MEM_HOST_NO_ACCESS. Also apply the same flag masking to
clCreateBufferWithProperties, clCreateImage, and clCreateImageWithProperties,
which were previously missing it.

@bashbaug bashbaug left a comment

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.

Thank you for your contribution!

At some point we should factor this into a helper function / macro, but that can happen in a different PR.

@bashbaug
bashbaug merged commit 6c9cf0e into intel:main Sep 7, 2026
8 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