Hash :
061a43c6
Author :
Date :
2025-08-13T16:35:20
CL/Vulkan: Implement cl_khr_priority_hints cl::CommandQueue contains queue priority from clCreateCommandQueueWithProperties. Similar to EGL_IMG_context_priority, a queue with a pre-assigned priority is selected when submission. Bug: angleproject:433980937 Tests-Passing: OCLCTS.test_api queue_hint Change-Id: I3a7bcc62e5d8186b51f771ab2c01cc18ddfcd195 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6785088 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Austin Annestrand <a.annestrand@samsung.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
//
// Copyright 2021 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// CLExtensions.cpp: Implements the struct methods for CLExtension.
#include "libANGLE/renderer/CLExtensions.h"
#include "libANGLE/renderer/cl_types.h"
#include "common/string_utils.h"
namespace rx
{
CLExtensions::CLExtensions() = default;
CLExtensions::~CLExtensions() = default;
CLExtensions::CLExtensions(CLExtensions &&) = default;
CLExtensions &CLExtensions::operator=(CLExtensions &&) = default;
void CLExtensions::initializeExtensions(std::string &&extensionStr)
{
ASSERT(extensions.empty());
extensions.assign(std::move(extensionStr));
if (extensions.empty())
{
return;
}
auto hasExtension = [&](const std::string &extension) {
return angle::ContainsToken(extensions, ' ', extension);
};
khrByteAddressableStore = hasExtension("cl_khr_byte_addressable_store");
khrGlobalInt32BaseAtomics = hasExtension("cl_khr_global_int32_base_atomics");
khrGlobalInt32ExtendedAtomics = hasExtension("cl_khr_global_int32_extended_atomics");
khrLocalInt32BaseAtomics = hasExtension("cl_khr_local_int32_base_atomics");
khrLocalInt32ExtendedAtomics = hasExtension("cl_khr_local_int32_extended_atomics");
khr3D_ImageWrites = hasExtension("cl_khr_3d_image_writes");
khrDepthImages = hasExtension("cl_khr_depth_images");
khrImage2D_FromBuffer = hasExtension("cl_khr_image2d_from_buffer");
khrExtendedVersioning = hasExtension("cl_khr_extended_versioning");
khrFP64 = hasExtension("cl_khr_fp64");
khrICD = hasExtension("cl_khr_icd");
khrInt64BaseAtomics = hasExtension("cl_khr_int64_base_atomics");
khrInt64ExtendedAtomics = hasExtension("cl_khr_int64_extended_atomics");
khrIntegerDotProduct = hasExtension("cl_khr_integer_dot_product");
khrExternalMemory = hasExtension("cl_khr_external_memory");
khrPriorityHints = hasExtension("cl_khr_priority_hints");
}
void CLExtensions::initializeVersionedExtensions(const NameVersionVector &versionedExtList)
{
ASSERT(extensionsWithVersion.empty());
ASSERT(extensions.empty());
extensionsWithVersion = std::move(versionedExtList);
std::string extensionString = "";
for (cl_name_version ext : extensionsWithVersion)
{
extensionString += ext.name;
extensionString += " ";
}
return initializeExtensions(std::move(extensionString));
}
bool CLExtensions::populateSupportedExternalMemoryHandleTypes(
ExternalMemoryHandleBitset supportedHandles)
{
externalMemoryHandleSupport = supportedHandles;
if (externalMemoryHandleSupport.test(cl::ExternalMemoryHandle::OpaqueFd))
{
externalMemoryHandleSupportList.push_back(cl::ToCLenum(cl::ExternalMemoryHandle::OpaqueFd));
}
if (externalMemoryHandleSupport.test(cl::ExternalMemoryHandle::DmaBuf))
{
externalMemoryHandleSupportList.push_back(cl::ToCLenum(cl::ExternalMemoryHandle::DmaBuf));
}
return externalMemoryHandleSupport.any();
}
} // namespace rx