Skip to content

Commit

Permalink
CL: Fix Non-Uniform Query check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
annestrand authored and Angle LUCI CQ committed Dec 13, 2024
1 parent 8caf0e7 commit 5fad41a
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/libANGLE/CLDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,24 @@ bool Device::supportsNonUniformWorkGroups() const
{
cl_bool support = false;

if (IsError(mImpl->getInfoUInt(DeviceInfo::NonUniformWorkGroupSupport, &support)))
if (getPlatform().isVersionOrNewer(3, 0))
{
UNREACHABLE();
if (IsError(mImpl->getInfoUInt(DeviceInfo::NonUniformWorkGroupSupport, &support)))
{
UNREACHABLE();
}
}
else
{
// Check older platforms support via device extension
// TODO(aannestrand) Boolean-ify these extension strings rather than string compare
// http://anglebug.com/381335059
if (getInfo().extensions.find("cl_arm_non_uniform_work_group_size") != std::string::npos)
{
support = true;
}
}

return support;
}

Expand Down

0 comments on commit 5fad41a

Please sign in to comment.