From 40a0935899d2a029c7352703688641d9de12fd8a Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Tue, 31 Aug 2021 11:17:25 +0100 Subject: [PATCH] ac/gpu_info: add has_accelerated_dot_product Signed-off-by: Rhys Perry Reviewed-by: Samuel Pitoiset Part-of: --- src/amd/common/ac_gpu_info.c | 7 +++++++ src/amd/common/ac_gpu_info.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/amd/common/ac_gpu_info.c b/src/amd/common/ac_gpu_info.c index b7d04e8e68b..029e1bc3b62 100644 --- a/src/amd/common/ac_gpu_info.c +++ b/src/amd/common/ac_gpu_info.c @@ -870,6 +870,13 @@ bool ac_query_gpu_info(int fd, void *dev_p, struct radeon_info *info, /* Whether chips support double rate packed math instructions. */ info->has_packed_math_16bit = info->chip_class >= GFX9; + /* Whether chips support dot product instructions. A subset of these support a smaller + * instruction encoding which accumulates with the destination. + */ + info->has_accelerated_dot_product = + info->family == CHIP_ARCTURUS || info->family == CHIP_ALDEBARAN || + info->family == CHIP_VEGA20 || info->family >= CHIP_NAVI12; + /* TODO: Figure out how to use LOAD_CONTEXT_REG on GFX6-GFX7. */ info->has_load_ctx_reg_pkt = info->chip_class >= GFX9 || (info->chip_class >= GFX8 && info->me_fw_feature >= 41); diff --git a/src/amd/common/ac_gpu_info.h b/src/amd/common/ac_gpu_info.h index c928677369d..142156a527c 100644 --- a/src/amd/common/ac_gpu_info.h +++ b/src/amd/common/ac_gpu_info.h @@ -70,6 +70,7 @@ struct radeon_info { bool has_load_ctx_reg_pkt; bool has_out_of_order_rast; bool has_packed_math_16bit; + bool has_accelerated_dot_product; bool cpdma_prefetch_writes_memory; bool has_gfx9_scissor_bug; bool has_tc_compat_zrange_bug;