mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-26 08:49:02 +00:00
Fix build_with_il on devices older than 2.1 (#1065)
The get_device_il_version_string() function throws an exception if the device does not support the CL_DEVICE_IL_VERSION query, so don't call this unless the version is recent enough.
This commit is contained in:
@@ -262,14 +262,21 @@ public:
|
|||||||
const cl_device_id device)
|
const cl_device_id device)
|
||||||
: build_base{ context, device }
|
: build_base{ context, device }
|
||||||
{
|
{
|
||||||
|
/* Disable build_with_il if neither core nor extension functionality is
|
||||||
|
* available */
|
||||||
|
m_enabled = false;
|
||||||
|
|
||||||
Version version = get_device_cl_version(device);
|
Version version = get_device_cl_version(device);
|
||||||
std::string sILVersion = get_device_il_version_string(device);
|
if (version >= Version(2, 1))
|
||||||
if ((version >= Version(2, 1) && version < Version(3, 0))
|
{
|
||||||
|| (version >= Version(3, 0) && !sILVersion.empty()))
|
std::string sILVersion = get_device_il_version_string(device);
|
||||||
|
if (version < Version(3, 0) || !sILVersion.empty())
|
||||||
{
|
{
|
||||||
m_CreateProgramWithIL = clCreateProgramWithIL;
|
|
||||||
m_enabled = true;
|
m_enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_CreateProgramWithIL = clCreateProgramWithIL;
|
||||||
|
}
|
||||||
else if (is_extension_available(device, "cl_khr_il_program"))
|
else if (is_extension_available(device, "cl_khr_il_program"))
|
||||||
{
|
{
|
||||||
m_CreateProgramWithIL = (decltype(m_CreateProgramWithIL))
|
m_CreateProgramWithIL = (decltype(m_CreateProgramWithIL))
|
||||||
@@ -282,12 +289,6 @@ public:
|
|||||||
}
|
}
|
||||||
m_enabled = true;
|
m_enabled = true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Disable build_with_il if neither core nor extension functionality
|
|
||||||
* is available */
|
|
||||||
m_enabled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
cl_uint address_bits{};
|
cl_uint address_bits{};
|
||||||
const cl_int err =
|
const cl_int err =
|
||||||
|
|||||||
Reference in New Issue
Block a user