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

[OpenCL] Add bounds checking to the Enqueue memory operations. #1049

Closed

Conversation

aarongreig
Copy link
Contributor

This allows us to return UR_ERROR_INVALID_SIZE when we should. Extra
checks are only performed on a non-success error code.

Also merge urQueueCreate InvalidValueProperties test into
InvalidQueueProperties test.
Normally OpenCL limits fill type operations to a max pattern size of
128, this patch includes a workaround to extend that.
Also ignore flags in no-op urEnqueueUSMPrefetch hint.
Also return RESULT_SUCCESS for no-op UR_KERNEL_EXEC_INFO_CACHE_CONFIG
hint.
Also includes a few other GetInfo related fixes:
* Add missing device info queries
* Add mapping of CL command type to UR command type
* Correct mapping of UR_QUEUE_INFO_FLAGS
* Add mapping of cl_command_queue_properties to ur_queue_flags_t
* Add mapping of cl_unified_shared_memory_type_intel to ur_usm_type_t
* Add UNSUPPORTED_ENUMERATION path to KernelGeGroupInfo tests.

And a fix related to one of the fixed queries:
* Populate pfnReadHostPipe and pfnWriteHostPipe ddi table entries.
@aarongreig aarongreig requested review from a team as code owners November 7, 2023 16:34
@aarongreig
Copy link
Contributor Author

I had to base this on the mega fix branch as there was a non-trivial overlap in EnqueueMemBufferFill. Only the top commit is relevant.

@aarongreig
Copy link
Contributor Author

(and by top commit I mean most recent... which on github is the bottom commit)

@aarongreig aarongreig force-pushed the aaron/clCTSEnqueueBoundsChecks branch from 7fdc688 to 27349dc Compare November 7, 2023 16:37
This allows us to return UR_ERROR_INVALID_SIZE when we should. Extra
checks are only performed on a non-success error code.

Also adds a missing bounds check to urMemBufferPartition
@aarongreig aarongreig force-pushed the aaron/clCTSEnqueueBoundsChecks branch from 27349dc to f65473d Compare November 8, 2023 11:38
Copy link
Contributor

@kbenzie kbenzie left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@omarahmed1111 omarahmed1111 left a comment

Choose a reason for hiding this comment

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

LGTM, just a small nit

source/adapters/opencl/device.cpp Show resolved Hide resolved
@aarongreig aarongreig closed this Nov 8, 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.

3 participants