Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect natural vector size on Zen4 #8570

Merged
merged 2 commits into from
Feb 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/Target.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1458,16 +1458,22 @@ int Target::natural_vector_size(const Halide::Type &t) const {
}
} else if (arch == Target::X86) {
if (is_integer && (has_feature(Halide::Target::AVX512_Skylake) ||
has_feature(Halide::Target::AVX512_Cannonlake))) {
// AVX512BW exists on Skylake and Cannonlake
has_feature(Halide::Target::AVX512_Cannonlake) ||
has_feature(Halide::Target::AVX512_Zen4) ||
has_feature(Halide::Target::AVX512_SapphireRapids))) {
// AVX512BW exists on any of these avx512 variants
return 64 / data_size;
} else if (t.is_float() && (has_feature(Halide::Target::AVX512) ||
has_feature(Halide::Target::AVX512_KNL) ||
has_feature(Halide::Target::AVX512_Skylake) ||
has_feature(Halide::Target::AVX512_Cannonlake))) {
has_feature(Halide::Target::AVX512_Cannonlake) ||
has_feature(Halide::Target::AVX512_Zen4) ||
has_feature(Halide::Target::AVX512_SapphireRapids))) {
// AVX512F is on all AVX512 architectures
return 64 / data_size;
} else if (has_feature(Halide::Target::AVX2)) {
} else if (has_feature(Halide::Target::AVX2) ||
has_feature(Halide::Target::AVX512) ||
has_feature(Halide::Target::AVX512_KNL)) {
// AVX2 uses 256-bit vectors for everything.
return 32 / data_size;
} else if (!is_integer && has_feature(Halide::Target::AVX)) {
Expand Down
Loading