-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add buffer location enum #34
Conversation
630349d
to
6b013eb
Compare
This change is almost ready to go, the enum made into public khronos repo. I will make a separate PR to sync upstream headers, and then polish this a little. PR that sync Khronos header is here |
da69878
to
0dbe561
Compare
This change is ready to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sherry-yuan, great work!
Could you amend the commit message with links to the corresponding PRs in the OpenCL specification and header repositories?
bf9ef40
to
5f6aec7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Sherry for the testing! One minor change for Klocwork and it is ready to be merged.
5f6aec7
to
3c2e402
Compare
Sycl runtime calls clEnqueueWriteBuffer before clSetKernelArgs, this cause the buffer to be allocated on the device before knowing the right place of allocating the memory. As a result, later when kernel get invoked, the memory has to be copied from device's default global memory to the buffer location specified in kernel. This is an additional memory copy operation. This extension does not interfer with the other way of setting buffer location (i.e through clSetKernelArgs). This property exist for integration with sycl runtime, not for pure opencl user to use. If opencl user wish to use this property, they have to make sure the buffer location passed into clCreateBufferWithPropertyINTEL has to match the one defined in kernel function interface, otherwise the extra memory copy issue will remain. When resizing reserved allocation, we now have the information to allocate minimum amount of space required according to the property passed in. This is done to align with opencl docs and header in; KhronosGroup/OpenCL-Headers#193 KhronosGroup/OpenCL-Docs#746
3c2e402
to
06324e2
Compare
Sycl runtime calls clEnqueueWriteBuffer before clSetKernelArgs, this cause the buffer to be allocated on the device before knowing the right place of allocating the memory. As a result, later when kernel get invoked, the memory has to be copied from device's default global memory to the buffer location specified in kernel. This is an additional memory copy operation.
This extension does not interfer with the other way of setting buffer location (i.e through clSetKernelArgs). This property exist for integration with sycl runtime, not for pure opencl user to use. If opencl user wish to use this property, they have to make sure the buffer location passed into clCreateBufferWithPropertyINTEL has to match the one defined in kernel function interface, otherwise the extra memory copy issue will remain.
When resizing reserved allocation, we now have the information to allocate minimum amount of space required according to the property passed in.