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

Add mechanism to specify named win32 NT handles. #1004

Closed
wants to merge 1 commit into from

Conversation

nikhiljnv
Copy link
Contributor

Currently, cl_khr_external_semaphore and cl_khr_external_memory define properties
to specify external win32 NT handle via pointer. Win32 NT handles can also be specified
via named strings.

Add properties to specify external Win32 NT handles via named strings too.

Fixes #943

Currently, cl_khr_external_semaphore and cl_khr_external_memory
define properties to specify external win32 NT handle via pointer.
Win32 NT handles can also be specified via named strings.
Add properties to specify external Win32 NT handles via named strings too.

Fixes #943
@oddhack
Copy link
Contributor

oddhack commented Mar 22, 2024

@bashbaug @nikhiljnv with #950 merged, this will have to be rewritten in terms of the new API spec structure and markup. I'm not sure how many more outstanding PRs that modify or add new khr extensions there are but they will all be likewise affected.

I can assist if need be, but this may act as a good test of how difficult it will be for people to move over to the new model.

@@ -395,6 +396,7 @@ The `cl_khr_external_memory_win32` extension extends {cl_external_memory_handle_
--
* {CL_EXTERNAL_MEMORY_HANDLE_OPAQUE_WIN32_KHR} specifies an NT handle that has only limited valid usage outside of OpenCL and other compatible APIs. It must be compatible with the functions DuplicateHandle, CloseHandle, CompareObjectHandles, GetHandleInformation, and SetHandleInformation. It owns a reference to the underlying memory resource represented by its memory object.
* {CL_EXTERNAL_MEMORY_HANDLE_OPAQUE_WIN32_KMT_KHR} specifies a global share handle that has only limited valid usage outside of OpenCL and other compatible APIs. It is not compatible with any native APIs. It does not own a reference to the underlying memory resource represented by its memory object, and will therefore become invalid when all memory objects associated with it are destroyed.
* {CL_EXTERNAL_MEMORY_HANDLE_OPAQUE_WIN32_NAME_KHR} specifies an NT handle name that has only limited valid usage outside of OpenCL and other compatible APIs. It must be compatible with the functions DuplicateHandle, CloseHandle, CompareObjectHandles, GetHandleInformation, and SetHandleInformation. It owns a reference to the underlying memory resource represented by its memory object.
Copy link

Choose a reason for hiding this comment

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

Are DuplicateHandle, CloseHandle etc. OpenCL commands?

Copy link
Contributor

Choose a reason for hiding this comment

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

They are Windows API calls.

Choose a reason for hiding this comment

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

We are fine with this PR

@nikhiljnv
Copy link
Contributor Author

Closing in favor of more recent PR #1177

@nikhiljnv nikhiljnv closed this Jun 11, 2024
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.

Importing external memory via named NT handle reference along with pointer reference
4 participants