Skip to content

Commit ee4af4e

Browse files
committed
fix features
1 parent 2610381 commit ee4af4e

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

ggml/src/ggml-vulkan/ggml-vulkan.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,7 @@ enum vk_device_architecture {
203203
};
204204

205205
static bool is_gcn(vk_device_architecture arch) {
206-
if ((arch == AMD_GCN12) || (arch == AMD_GCN34) || (arch == AMD_GCN5))
207-
return true;
208-
else
209-
return false;
206+
return (arch == AMD_GCN12) || (arch == AMD_GCN34) || (arch == AMD_GCN5);
210207
}
211208

212209
static vk_device_architecture get_device_architecture(const vk::PhysicalDevice& device) {
@@ -240,19 +237,24 @@ static vk_device_architecture get_device_architecture(const vk::PhysicalDevice&
240237
vk::PhysicalDeviceShaderCorePropertiesAMD shader_core_props_amd;
241238
vk::PhysicalDeviceShaderIntegerDotProductPropertiesKHR integer_dot_props;
242239
vk::PhysicalDeviceSubgroupSizeControlPropertiesEXT subgroup_size_control_props;
243-
vk::PhysicalDeviceShaderFloat16Int8FeaturesKHR float16_int8_props;
244240

245241
props2.pNext = &shader_core_props_amd;
246242
shader_core_props_amd.pNext = &integer_dot_props;
247243
integer_dot_props.pNext = &subgroup_size_control_props;
248-
subgroup_size_control_props.pNext = &float16_int8_props;
249244

250245
device.getProperties2(&props2);
251246

247+
vk::PhysicalDeviceFeatures2 features2;
248+
vk::PhysicalDeviceShaderFloat16Int8FeaturesKHR float16_int8_features;
249+
250+
features2.pNext = &float16_int8_features;
251+
252+
device.getFeatures2(&features2);
253+
252254
if (subgroup_size_control_props.maxSubgroupSize == 64 && subgroup_size_control_props.minSubgroupSize == 64) {
253255
// GCN
254256
if (shader_core_props_amd.sgprAllocationGranularity == 16) {
255-
if (float16_int8_props.shaderFloat16) {
257+
if (float16_int8_features.shaderFloat16) {
256258
return vk_device_architecture::AMD_GCN5;
257259
} else {
258260
return vk_device_architecture::AMD_GCN34;

0 commit comments

Comments
 (0)