Skip to content

Commit 421dd0a

Browse files
trivedivivekYIWENX14
authored andcommitted
Fixing linux build.
Differential Revision: D67997666 Pull Request resolved: #7580
1 parent 9cb0432 commit 421dd0a

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ 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 uint div_by_x = gl_GlobalInvocationID.x / out_limits.x;
39+
const ivec3 pos = ivec3(
40+
gl_GlobalInvocationID.x % out_limits.x,
41+
div_by_x % out_limits.y,
42+
div_by_x / out_limits.y);
3943

4044
if (any(greaterThanEqual(pos, out_limits))) {
4145
return;

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ 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 uint div_by_x = gl_GlobalInvocationID.x / out_limits_xy_scaled.x;
51+
ivec3 pos = ivec3(
52+
gl_GlobalInvocationID.x % out_limits_xy_scaled.x,
53+
div_by_x % out_limits_xy_scaled.y,
54+
div_by_x / out_limits_xy_scaled.y);
5155

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

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ 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 uint div_by_x = gl_GlobalInvocationID.x / out_limits_scaled.x;
48+
const ivec3 gpos = ivec3(
49+
gl_GlobalInvocationID.x % out_limits_scaled.x,
50+
div_by_x % out_limits_scaled.y,
51+
div_by_x / out_limits_scaled.y);
4852

4953
// Output position for TILE_SIZE = 2
5054
// +--------+--------+

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,6 @@ 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;
228-
return ivec3(idx % size_x, div_by_x % size_y, div_by_x / size_y);
229-
}
230-
231226
#ifdef USING_BUFFER
232227
#define load_texel(buf, idx) buf[idx]
233228
#elif defined(USING_TEXTURE2D)

0 commit comments

Comments
 (0)