Skip to content

Commit baffce5

Browse files
trivedivivekfacebook-github-bot
authored andcommitted
Fixing linux build. (#7580)
Summary: Fixing build issue in unittest / linux / linux-job 2025-01-09T21:17:15.4021836Z /pytorch/executorch/cmake-out/conv2d_dw_half.glsl:58: error: 'idx_to_ipos_x_wise' : no matching overloaded function found 2025-01-09T21:17:15.4022815Z /pytorch/executorch/cmake-out/conv2d_dw_half.glsl:58: error: 'const' : non-matching or non-convertible constant type for const initializer 2025-01-09T21:17:15.4023491Z 2 errors generated. 2025-01-09T21:17:15.4024083Z /pytorch/executorch/cmake-out/conv2d_dw_output_tile_3x3_half.glsl:70: error: 'idx_to_ipos_x_wise' : no matching overloaded function found 2025-01-09T21:17:15.4025172Z /pytorch/executorch/cmake-out/conv2d_dw_output_tile_3x3_half.glsl:70: error: '=' : cannot convert from ' const float' to ' temp highp 3-component vector of int' 2025-01-09T21:17:15.4025903Z 2 errors generated. 2025-01-09T21:17:15.4026440Z /pytorch/executorch/cmake-out/conv2d_pw_half.glsl:67: error: 'idx_to_ipos_x_wise' : no matching overloaded function found 2025-01-09T21:17:15.4027412Z /pytorch/executorch/cmake-out/conv2d_pw_half.glsl:67: error: 'const' : non-matching or non-convertible constant type for const initializer Reviewed By: jorgep31415 Differential Revision: D67997666
1 parent 478198b commit baffce5

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

backends/vulkan/runtime/graph/ops/glsl/conv2d_dw.glsl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ layout(local_size_x_id = 0, local_size_y_id = 1, local_size_z_id = 2) in;
3535
* output at a single output location.
3636
*/
3737
void main() {
38-
const ivec3 pos = idx_to_ipos_x_wise(gl_GlobalInvocationID.x, out_limits.x, out_limits.y);
38+
const ivec3 gid = ivec3(gl_GlobalInvocationID);
39+
const ivec3 pos = idx_to_ipos_x_wise(gid.x, out_limits.x, out_limits.y);
3940

4041
if (any(greaterThanEqual(pos, out_limits))) {
4142
return;

backends/vulkan/runtime/graph/ops/glsl/conv2d_dw_output_tile.glsl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ void main() {
4747
// since work size is calculated by x * ((y + B_Y - 1) / B_Y) * z
4848
const ivec2 out_limits_xy_scaled = (out_limits.xy + ivec2(BATCH_SIZE_X, BATCH_SIZE_Y) - 1) / ivec2(BATCH_SIZE_X, BATCH_SIZE_Y);
4949

50-
ivec3 pos = idx_to_ipos_x_wise(gl_GlobalInvocationID.x, out_limits_xy_scaled.x, out_limits_xy_scaled.y);
50+
const ivec3 gid = ivec3(gl_GlobalInvocationID);
51+
ivec3 pos = idx_to_ipos_x_wise(gid.x, out_limits_xy_scaled.x, out_limits_xy_scaled.y);
5152

5253
// scale pos.xy by batch sizes, because that's the top pixel to be processed
5354
pos.x *= BATCH_SIZE_X;

backends/vulkan/runtime/graph/ops/glsl/conv2d_pw.glsl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ void main() {
4444
const ivec2 out_limits_scaled = (out_limits.xy + TILE_SIZE - 1) / TILE_SIZE;
4545
const uint shared_mem_stride = gl_WorkGroupSize.x * gl_WorkGroupSize.y * gl_WorkGroupSize.z;
4646

47-
const ivec3 gpos = idx_to_ipos_x_wise(gl_GlobalInvocationID.x, out_limits_scaled.x, out_limits_scaled.y);
47+
const ivec3 gid = ivec3(gl_GlobalInvocationID);
48+
const ivec3 gpos = idx_to_ipos_x_wise(gid.x, out_limits_scaled.x, out_limits_scaled.y);
4849

4950
// Output position for TILE_SIZE = 2
5051
// +--------+--------+

backends/vulkan/runtime/graph/ops/glsl/indexing_utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ ivec3 lpos_to_pos(const ivec3 lpos, const ivec4 axis_map) {
223223
return pos;
224224
}
225225

226-
ivec3 idx_to_ipos_x_wise(uint idx, int size_x, int size_y) {
227-
const uint div_by_x = idx / size_x;
226+
ivec3 idx_to_ipos_x_wise(int idx, int size_x, int size_y) {
227+
int div_by_x = idx / size_x;
228228
return ivec3(idx % size_x, div_by_x % size_y, div_by_x / size_y);
229229
}
230230

0 commit comments

Comments
 (0)