Skip to content

[SYCL][UR][L0 v2] import host ptr when SYCL_USM_HOSTPTR_IMPORT=1 and fix mapHostPtr #19297

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

Merged
merged 3 commits into from
Jul 17, 2025

Conversation

igchor
Copy link
Member

@igchor igchor commented Jul 3, 2025

No description provided.

@igchor igchor requested a review from a team as a code owner July 3, 2025 17:37
@igchor igchor temporarily deployed to WindowsCILock July 3, 2025 17:37 — with GitHub Actions Inactive
@igchor igchor temporarily deployed to WindowsCILock July 3, 2025 17:59 — with GitHub Actions Inactive
@igchor igchor temporarily deployed to WindowsCILock July 3, 2025 17:59 — with GitHub Actions Inactive
igchor added 2 commits July 3, 2025 18:26
This matches v1 functionality and speeds up subsequent
buffer map/unmap operations by making memory copy faster.
The logic for freeing mappedPtr was incorrect. We should only free
the memory in unmapHostPtr if the pointer was allocated in mapHostPtr,
not the other way around.
Copy link
Contributor

@pbalcer pbalcer left a comment

Choose a reason for hiding this comment

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

lgtm, but tests seem to be failing:

native_specialization_constant

@igchor igchor temporarily deployed to WindowsCILock July 7, 2025 16:00 — with GitHub Actions Inactive
@igchor
Copy link
Member Author

igchor commented Jul 7, 2025

lgtm, but tests seem to be failing:

native_specialization_constant

Fixed. It seems that UR_MEM_FLAG_USE_HOST_POINTER does not have to be set when hostPtr is not null. In the legacy adapter this flag controlled whether to import the memory to USM or not but I don't see a reason not to do it in all cases. It seems that SYCL almost always sets UR_MEM_FLAG_USE_HOST_POINTER anyway (except in that one test)

@igchor igchor temporarily deployed to WindowsCILock July 7, 2025 16:36 — with GitHub Actions Inactive
@igchor igchor temporarily deployed to WindowsCILock July 7, 2025 16:36 — with GitHub Actions Inactive
@igchor
Copy link
Member Author

igchor commented Jul 7, 2025

Actually, I wonder why do we event support that combination (non-null hostPtr and no USE_HOST_PTR flag). OpenCL doesn't seem to allow this: https://registry.khronos.org/OpenCL/sdk/3.0/docs/man/html/clCreateBuffer.html

@igchor igchor merged commit bf28ba0 into intel:sycl Jul 17, 2025
33 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.

2 participants