You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The change for issue #14 returns UUIDs or LUIDs for the relevant device param names.
The current implementation gets the values as a Vec<u8> then copies them into arrays of the appropriate size, i.e.: [u8; CL_UUID_SIZE_KHR] and [u8; CL_LUID_SIZE_KHR], so far so good.
The issue is that the library will panic if a device returns the wrong size for a UUID or LUID, either from the explicit assert or in the call to copy_from_slice.
This is wrong: the library shouldn't panic on bad data from a device, it should just return a Result error value.
The text was updated successfully, but these errors were encountered:
The fix for the issue is to get UUIDs or LUIDs explicitly as values using CL_UUID_SIZE_KHR and CL_LUID_SIZE_KHR as the appropriate size parameter when calling clGetDeviceInfo.
Not only does this no longer panic, but it also only calls clGetDeviceInfo once instead of twice: once to get the size and then again to get the data. It also saves copying the data from the Vec<u8> into the UUID or LUID array.
Unfortunately, it was not possible to use the api_info_value! macro since the array type does not implement the Default trait.
The change for issue #14 returns UUIDs or LUIDs for the relevant device param names.
The current implementation gets the values as a
Vec<u8>
then copies them into arrays of the appropriate size, i.e.:[u8; CL_UUID_SIZE_KHR]
and[u8; CL_LUID_SIZE_KHR]
, so far so good.The issue is that the library will panic if a device returns the wrong size for a UUID or LUID, either from the explicit
assert
or in the call tocopy_from_slice
.This is wrong: the library shouldn't panic on bad data from a device, it should just return a Result error value.
The text was updated successfully, but these errors were encountered: