Skip to content

Commit

Permalink
Disable Vulkan for shuffle test.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcourteaux committed Jan 15, 2025
1 parent 1135414 commit bcb2cf8
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions test/correctness/shuffle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ using namespace Halide;

int main(int argc, char **argv) {
Target target = get_jit_target_from_environment();
if (target.has_feature(Target::Feature::Vulkan)) {
std::printf("[SKIP] Vulkan seems to be not working.\n");
return 0;
}

Var x{"x"}, y{"y"};

Expand All @@ -16,17 +20,14 @@ int main(int argc, char **argv) {
Expr shuffle = Halide::Internal::Shuffle::make({vec1, vec2}, {3, 1, 6, 7, 2, 4, 0, 5});
Expr result = shuffle * shuffle;

if (true || target.has_feature(Target::Feature::Vulkan)) {
Expr a_half1 = Halide::Internal::Shuffle::make_slice(result, 0, 1, 4);
Expr a_half2 = Halide::Internal::Shuffle::make_slice(result, 4, 1, 4);
Expr a_sumhalves = a_half1 + a_half2;
Expr b_half1 = Halide::Internal::Shuffle::make_slice(a_sumhalves, 0, 1, 2);
Expr b_half2 = Halide::Internal::Shuffle::make_slice(a_sumhalves, 2, 1, 2);
Expr b_sumhalves = b_half1 + b_half2;
g(x) = Internal::Shuffle::make_extract_element(b_sumhalves, 0) + Halide::Internal::Shuffle::make_extract_element(b_sumhalves, 1);
} else {
g(x) = Internal::VectorReduce::make(Halide::Internal::VectorReduce::Add, result, 1);
}
// Manual logarithmic reduce.
Expr a_half1 = Halide::Internal::Shuffle::make_slice(result, 0, 1, 4);
Expr a_half2 = Halide::Internal::Shuffle::make_slice(result, 4, 1, 4);
Expr a_sumhalves = a_half1 + a_half2;
Expr b_half1 = Halide::Internal::Shuffle::make_slice(a_sumhalves, 0, 1, 2);
Expr b_half2 = Halide::Internal::Shuffle::make_slice(a_sumhalves, 2, 1, 2);
Expr b_sumhalves = b_half1 + b_half2;
g(x) = Internal::Shuffle::make_extract_element(b_sumhalves, 0) + Halide::Internal::Shuffle::make_extract_element(b_sumhalves, 1);

f0.compute_root();
f1.compute_root();
Expand Down

0 comments on commit bcb2cf8

Please sign in to comment.