Skip to content

Commit

Permalink
[ET-VK] Minor improvements to conv2d pw and dw bounds check.
Browse files Browse the repository at this point in the history
Differential Revision: D68400689

Pull Request resolved: #7815
  • Loading branch information
trivedivivek authored Jan 27, 2025
1 parent b6dc42c commit ebbe962
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backends/vulkan/runtime/graph/ops/glsl/conv2d_dw.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void main() {
div_by_x % out_limits.y,
div_by_x / out_limits.y);

if (any(greaterThanEqual(pos, out_limits))) {
if (pos.z >= out_limits.z) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void main() {
pos.y *= BATCH_SIZE_Y;

// do not process if top pixel does not fit within the output range
if (any(greaterThanEqual(pos, out_limits))) {
if (pos.z >= out_limits.z) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void main() {
div_by_x % out_limits.y,
div_by_x / out_limits.y);

if (any(greaterThanEqual(pos, out_limits))) {
if (pos.z >= out_limits.z) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion backends/vulkan/runtime/graph/ops/glsl/conv2d_pw.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void main() {

// If the top left position is out of bounds, then this invocation will have
// no work to do.
if (any(greaterThanEqual(ivec3(pos[0], gpos.z), out_limits.xyz))) {
if (gpos.z >= out_limits.z) {
return;
}

Expand Down

0 comments on commit ebbe962

Please sign in to comment.