Skip to content

Commit

Permalink
[CodeGen][OpenCL] Limit OpenCL built-in vector lanes to 2, 3, 4, 8, 1…
Browse files Browse the repository at this point in the history
…6. (apache#7777)
  • Loading branch information
xndcn authored and Trevor Morris committed May 6, 2021
1 parent 63fe078 commit b16784a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/target/source/codegen_opencl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void CodeGenOpenCL::PrintType(DataType t, std::ostream& os) { // NOLINT(*)
break;
}
if (!fail && lanes == 1) return;
if (!fail && (lanes >= 2 && lanes <= 16)) {
if (!fail && ((lanes >= 2 && lanes <= 4) || lanes == 8 || lanes == 16)) {
os << lanes;
return;
}
Expand Down Expand Up @@ -154,7 +154,7 @@ void CodeGenOpenCL::PrintType(DataType t, std::ostream& os) { // NOLINT(*)
break;
}
if (!fail && lanes == 1) return;
if (!fail && (lanes >= 2 && lanes <= 16)) {
if (!fail && ((lanes >= 2 && lanes <= 4) || lanes == 8 || lanes == 16)) {
os << lanes;
return;
}
Expand Down

0 comments on commit b16784a

Please sign in to comment.