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

[Exp] Added const qualifier to some parameters. #699

Closed
wants to merge 2 commits into from

Conversation

rdeodhar
Copy link
Contributor

@rdeodhar rdeodhar commented Jul 7, 2023

The context and host pointer parameters now have const qualifier.

@@ -10,10 +10,10 @@ name: ImportExp
details:
- "Import memory into USM"
params:
- type: $x_context_handle_t
- type: "const $x_context_handle_t"
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think the context should be const qualified the reason being that an adapter may wish to store data in the context relating to the action being performed in the urUSMImportExp/urUSMExportExp entry points, making this argument const means that becomes impossible. Making this const is also inconsistent with the rest of the API.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, removed that const on the UR context.
Note that at the SYCL level all USM APIs (such as malloc_device) that take a queue or context parameter declare them const. But its fine to have the underlying context modifiable.

@@ -30,10 +30,10 @@ name: ReleaseExp
details:
- "Release memory from USM"
params:
- type: $x_context_handle_t
- type: "const $x_context_handle_t"
Copy link
Contributor

Choose a reason for hiding this comment

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

Also don't think this should be const qualified, see above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm closing this PR because I don't think these changes are needed. There is a remapping, including casting, between SYCL objects and UR objects anyway.

@rdeodhar rdeodhar closed this Jul 10, 2023
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