src/libANGLE/CLDevice.cpp


Log

Author Commit Date CI Message
Tom Sepez 25390156 2025-08-21T00:13:19 Suppress unsafe buffers on a file-by-file basis in src/ [1 of N] In this CL, we suppress many files but stop short of actually enabling the warning by not removing the line from the unsafe_buffers_paths.txt file. That will happen in a follow-on CL, along with resolving any stragglers missed here. This is mostly a manual change so as to familiarize myself with the kinds of issues faced by the Angle codebase when applying buffer safety warnings. -- Re-generate affected hashes. -- Clang-format applied to all changed files. -- Add a few missing .reserve() calls to vectors as noticed. -- Fix some mismatches between file names and header comments. -- Be more consistent with header comment format (blank lines and trailing //-only lines when a filename comment adjoins license boilerplate). Bug: b/436880895 Change-Id: I3bde5cc2059acbe8345057289214f1a26f1c34aa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6869022 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Raja  Wasim Husain 8ef76b6a 2025-08-04T12:34:17 CL/Vulkan: cl_khr_external_memory extension (pt.2) - Make this extension visible if Vulkan implementation support features supportsExternalMemoryFd and/or supportsExternalMemoryDmaBuf - Implemented APIs clEnqueueAcquireExternalMemObjectsKHR and clEnqueueReleaseExternalMemObjectsKHR - Updated clCreateBufferWithProperties to handle external memory file descriptor. Bug: angleproject:378017028 Change-Id: I1751982c8e9b2cd07b7e251cc54db5dcd1bcda20 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6843980 Commit-Queue: Austin Annestrand <a.annestrand@samsung.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Hareesh Karada 7ad67712 2025-08-13T16:33:03 CL/Vulkan: Enable cl_khr_integer_dot_product extension - Enabled extension string and corresponding opencl_c features - Updated packed_cl_enums.json with three new enums - Enabled support for this extension in function clGetDeviceInfo - Add support for CL_DEVICE_OPENCL_C_FEATURES API query through clGetDeviceInfo corresponding integer_dot_product extension - Updated vk_features.json with new ANGLE Feature supports_shader_integer_dot_product - The changes in autogen files are generated by running the run_code_generation.py script Tests-Passing: ocl_cts: test_integer_ops integer_dot_product ocl_cts: test_compiler features_macro VK-GL-CTS:dEQP-VK.spirv_assembly.instruction.compute.opsdotkhr.* dEQP-VK.spirv_assembly.instruction.compute.opudotkhr.* dEQP-VK.spirv_assembly.instruction.compute.opsudotkhr.* dEQP-VK.spirv_assembly.instruction.compute.opsdotaccsatkhr.* dEQP-VK.spirv_assembly.instruction.compute.opudotaccsatkhr.* dEQP-VK.spirv_assembly.instruction.compute.opsudotaccsatkhr.* Bug: angleproject:433980939 Change-Id: Iae7a7753d0556beeb85c254c61a37a0d047df058 Signed-off-by: Hareesh Karada <hareesh.k@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6785089 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Austin Annestrand 5fad41a0 2024-12-03T17:18:35 CL: Fix Non-Uniform Query check The following method needs updating: https://github.com/google/angle/blob/main/src/libANGLE/CLDevice.cpp#L424 It currently does not account for lower OpenCL driver versions that do not contain the query value: CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT As this was only introduced as of OpenCL 3.0 support https://registry.khronos.org/OpenCL/specs/3.0-unified/html/OpenCL_API.html#CL_DEVICE_NON_UNIFORM_WORK_GROUP_SUPPORT Bug: angleproject:381335059 Change-Id: I9f1e61270690077bdca0be3aef0d88b77c27bf11 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6068289 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Gowtham Tammana 8dae26c6 2024-06-26T11:35:24 CL: Add missing validation checks -1- Check on device enqueue support Add a check for the device enqueue support before proceeding with the device enqueue info queries. -2- Validate the non uniform work groups The spec requires reporting CL_INVALID_WORK_GROUP_SIZE when non-uniform workgroups are not supported and supplied work sizes dont evenly distribute the work items. Adding a check in the validation. -3- Check for alignment on sub-buffer creation The spec requires the sub-buffer origin to be aligned to CL_DEVICE_MEM_BASE_ADDR_ALIGN value. Check for this in validation layer. Bug: angleproject:42267011 Change-Id: I9dc086fea16b200cc05c0fca29e3608403099a2c Signed-off-by: Gowtham Tammana <g.tammana@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5975419 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Austin Annestrand a9512a9f 2023-11-29T14:56:29 OpenCL: Replace error-return APIs to use angle::Result The motivation of converting existing CL APIs using "cl_int errorCode" to now use "angle::Result" is for better interop with internal ANGLE plumbing/abstractions. To facilitate this, we now make use of a TLS errorCode object that we set internally and read from entrypoint/stubs layer so that we can propagate back to user. Bug: angleproject:8435 Change-Id: I7c2a786019c33c56649be4b6e8b61bc318497bb1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5075772 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
John Plate 44a5c913 2021-06-17T09:29:29 CL: Make CL front end and back end thread-safe Add locking to all mutable variables of the CL objects in the front end and pass-through back end to make them thread-safe. This fixes a crash in a multi-threaded CTS test. Bug: angleproject:6015 Change-Id: I1d6471c851217639411c434c82acd32d14035291 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2967468 Commit-Queue: John Plate <jplate@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
John Plate 69562546 2021-06-11T19:12:11 CL: Refactor info structs and fix conformance bug - Remove variable name prefix from Info structs to be more consistent with other ANGLE structs. - Fix CL object validation check with magics, since the Mesa solution doesn't work without RTTI. - Add support for some extensions required by OpenCL 1.1 and for some optional extensions. - Fix more conformance bugs. Bug: angleproject:6015 Change-Id: I41b1c45d95059a9994f5dc78bf9b74476cc6f2d4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2956349 Commit-Queue: John Plate <jplate@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
John Plate 2c8d9a9a 2021-06-09T16:09:35 CL: Remaining functions for OpenCL 1.2 Add support for the remaining functions for OpenCL 1.2 for the front end and pass-through back end. Also fix several bugs discovered by the conformance tests. Bug: angleproject:6015 Change-Id: I1dca1c3f4c1d9aea7f0501094c171116ea01381f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2954259 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: John Plate <jplate@google.com>
John Plate 55df3ec1 2021-06-08T18:57:15 CL: Add remaining enqueue commands Add support for remaining OpenCL 1.2 enqueue commands to front end and pass-through back end. Bug: angleproject:6015 Change-Id: Iab650e42d51e2105dc826088d3606c56d5cd0fd5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2944966 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: John Plate <jplate@google.com>
John Plate 2e772e04 2021-06-04T14:01:42 CL: Add image enqueue commands Add image enqueue commands to front end and pass-through back end. Bug: angleproject:6015 Change-Id: I133e84020975679fafd29432c965cd19f086d2b4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2940837 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: John Plate <jplate@google.com>
John Plate 41b817f3 2021-05-31T17:38:43 CL: Add buffer enqueue commands Add buffer enqueue commands to front end and pass-through back end. Bug: angleproject:6015 Change-Id: I936530d31903e395550e4540339ebec2e6702e65 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2928425 Commit-Queue: John Plate <jplate@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
John Plate daf18594 2021-05-31T12:04:42 CL: Refactor front end entry functions Move all front end functions that are only called from the OpenCL entry points to a separate section at the top of the front end object class bodies, which improves readability. Bug: angleproject:6001 Change-Id: Id360adbf0c439e4068c379aa4ea1da25e99f7b53 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2928419 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
John Plate baca10b7 2021-05-29T16:26:57 CL: Remove object cache and fix multi-threading All CL front end objects used to be cached to be able to determine if an object has been created by the front end to check its validity. The validity is now checked with the existence of an intrinsic value (the dispatch table pointer), which is consistent with the patterns found in Mesa and clvk (though clvk uses a magic value). This allows the removal of all cached objects. The cached objects were stored with std::unique_ptr. These are now gone and all remaining pointers are now custom intrinsic reference count pointers. Also remove global lock which causes deadlocks, e.g. when CL API is called from a separate thread to unlock a blocking call with a user event. Most of the front end is constant and already thread-safe. The ref count is also thread-safe now (atomic). A few remaining locks will follow. Without the global lock it was now possible to make the API reentrant, and to remove the workaround with the Khronos ICD loader to skip ANGLE's OpenCL library. Bug: angleproject:6001 Change-Id: I7d3b52db9011a02cb7ea9ebdeb6e22c4c702ef5b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2927395 Commit-Queue: John Plate <jplate@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
John Plate 51ab3dc3 2021-05-25T16:54:11 CL: Improve validation readablity Improve validation readablity by introducing a bit field class and by changing how the CL error code is returned. Bug: angleproject:6001 Change-Id: I51deb745454e5281de725481edef85eb30be28c7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2919690 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: John Plate <jplate@google.com>
John Plate 1aa88398 2021-05-24T14:19:05 CL: program object creation for front end and pass-through Add program object to back end and implement creation and info query. Bug: angleproject:6001 Change-Id: If94db8ab8b491e1ac21c767347cabb6f4f3b3cba Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2912465 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: John Plate <jplate@google.com>
John Plate a6210a8f 2021-05-23T19:02:46 CL: image object creation for front end and pass-through Add image object to front end and implement creation and info query. Cache more Device info for Image validation. Bug: angleproject:5956 Change-Id: I38374f4c2c85287109c464ac90eb1bf49b07fa0a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2912805 Commit-Queue: John Plate <jplate@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
John Plate efd8da4d 2021-05-21T15:39:11 CL: buffer object creation for front end and pass-through Add Buffer object to front end and Memory object to back end. Implement creation of buffer and sub-buffer objects. Make cl::Object destructor virtual to support destruction of Buffer. Cache more Device info for Buffer validation. Add missing and move existing version checks into validation. Bug: angleproject:5956 Change-Id: Iea7665be5f6bdd8469e81f5fe4935a9fb0e03436 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2912677 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: John Plate <jplate@google.com>
John Plate 10a8182c 2021-05-19T21:00:05 CL: Fix querying default device if non exists Bug: angleproject:5992 Change-Id: Ie43f905fbb9cf41b0f6f88b2db27ebe9de9c37e8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2906993 Commit-Queue: John Plate <jplate@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
John Plate c2fd3388 2021-05-15T22:28:27 CL: Add front end object references to back end objects Add front end object references to back end objects, which requires a significant amount of refactoring, because the back end objects have to be constructed during the construction of the front end objects, so that the references can be passed to the back end objects, which then can be passed to the front end member initialization. That would have been easier with inheritance than with PImpl. Bug: angleproject:5904 Change-Id: Ib58e6a698e76987bdd63cd8088f923424d6c622b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2897249 Commit-Queue: John Plate <jplate@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
John Plate a7ae63e4 2021-05-14T21:55:52 CL: Move object cast from entry points to stubs and front end Move the OpenCl object cast from the generated entry points to the stubs and front end, to make it possible to properly use static_cast. This removes the limitation that the front end objects have to be standard layout (and makes it possible to use virtual functions), which is consistent with other front end objects. Move the back end initialization from the stubs to the entry point functions, which fixes a bug where the back ends were not initialized during validation. Move more code from the stubs to the front end, to keep the stubs light. Remove unused function `default_return_value` from `generate_entry_points.py`. Bug: angleproject:5904 Change-Id: Id999ad6c537888017bf3252c6f6e088b7d4c7984 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2897245 Commit-Queue: John Plate <jplate@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
John Plate 48b835cf 2021-05-09T22:47:00 CL: Implement context for front end and passthrough Bug: angleproject:5904 Change-Id: I23b764bba87be3a51a1b5b44b13968fc572efde9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2883773 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: John Plate <jplate@google.com>
John Plate b300dc52 2021-05-09T00:35:24 CL: device partitioning for front end and passthrough Partitioning is the creation of sub-devices. Also add reference counting for CL objects, which is needed now for sub-devices. Also fix CL print format strings, since cl_ulong is actually always 64 bit and not unsigned long. Bug: angleproject:5904 Change-Id: I006699fad2f953ce312bca87c9b6362b5d77a18a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2880665 Commit-Queue: John Plate <jplate@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
John Plate e369a282 2021-05-08T14:08:28 Implement CL device object for front end and passthrough Bug: angleproject:5904 Change-Id: I17f6d10ed59c62fe9126d29b7de2c127c5d0039a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2880662 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: John Plate <jplate@google.com>
John Plate 05fb2272 2021-04-27T19:31:31 Add support for OpenCL ICD Loader Bug: angleproject:5908 Change-Id: Idafc0d15b69f9a21f2ab5e48c4c34f0dc0e0ee96 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2854598 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: John Plate <jplate@google.com>
John Plate e25f3b10 2021-04-21T21:43:46 Generate empty CL object classes Bug: angleproject:5886 Change-Id: I01566f40e85bd7f5531536fdc1df42965622a939 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2844969 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: John Plate <jplate@google.com>