oneapi-src / level-zero

oneAPI Level Zero Specification Headers and Loader
https://spec.oneapi.com/versions/latest/elements/l0/source/index.html
MIT License
208 stars 90 forks source link

ze_device_kernel_properties_t.dp4aSupported contains garbage #8

Closed maleadt closed 4 years ago

maleadt commented 4 years ago
ze_device_kernel_properties_t kernel_properties;
kernel_properties.version = ZE_DEVICE_KERNEL_PROPERTIES_VERSION_CURRENT;
kernel_properties.dp4aSupported = 100;
zeDeviceGetKernelProperties(allDevices[d], &kernel_properties);

printf("dp4aSupported: %i\n", kernel_properties.dp4aSupported);

This retains the 100 value. Am I supposed to zero-initialize these structs?

Also, is the use of the version field correct here?

jandres742 commented 4 years ago

version is correct. You don't need to set the other values, as that's the only input parameter, and the others are outputs (see definition for that struct here https://spec.oneapi.com/versions/0.6.0/oneL0/core/api.html?highlight=zedevicecanaccesspeer#ze-device-kernel-properties-t). The rest are set by the driver when retrieving the properties.

Reason that field retains the value is because it's a boolean, so the driver most likely is just setting up to true, which is the same as 100 :)

maleadt commented 4 years ago

Reason that field retains the value is because it's a boolean, so the driver most likely is just setting up to true, which is the same as 100 :)

That doesn't appear to be the case, if I memset the struct to zero (or set the dp4aSupported field to 0) that value is preserved too, so it rather looks like the driver isn't setting anything.

jandres742 commented 4 years ago

Ok, so in this case, it looks like there's something missing in the implementation. Could you please create the issue in the Intel driver implementation, https://github.com/intel/compute-runtime, given that it looks like a bug in the GPU driver implementation and not in the loader?

maleadt commented 4 years ago

Done!