Added object comparability verification for program devices query (#2237)

Fixes #1485 according to work plan from issue description.
This commit is contained in:
Marcin Hajder
2025-02-25 17:43:12 +01:00
committed by GitHub
parent 0ddfbbe673
commit a90a8194bc
4 changed files with 162 additions and 13 deletions

View File

@@ -25,6 +25,26 @@
#include "procs.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