Added object comparability verification for context devices query (#2176)

Fixes #1485 according to work plan, point `CL_CONTEXT_DEVICES`
This commit is contained in:
Marcin Hajder
2025-02-25 17:42:09 +01:00
committed by GitHub
parent 32361e1d89
commit 0ddfbbe673
2 changed files with 168 additions and 8 deletions

View File

@@ -27,4 +27,24 @@
#include <sys/types.h>
#include <sys/stat.h>
// scope guard helper to ensure proper releasing of sub devices
struct SubDevicesScopeGuarded
{
SubDevicesScopeGuarded(const cl_int dev_count)
{
sub_devices.resize(dev_count);
}
~SubDevicesScopeGuarded()
{
for (auto &device : sub_devices)
{
cl_int err = clReleaseDevice(device);
if (err != CL_SUCCESS)
log_error("\n Releasing sub-device failed \n");
}
}
std::vector<cl_device_id> sub_devices;
};
#endif // _testBase_h