Fix binary_op int variant (#3745)
Summary:
Pull Request resolved: https://github.com/pytorch/executorch/pull/3745
We were using the wrong `sampler3D` meant for `float`/`half`, when we should use `isampler3D` for `int`. [The codegen has a `Dict` mapping](https://www.internalfb.com/code/fbsource/[ac566fa2c8cb64cceb5d47fe4a9c97241a73341d]/fbcode/executorch/backends/vulkan/runtime/api/gen_vulkan_spv.py?lines=58-71) to templatize this logic. Since we're already here, modernize to the new layout generation functions.
## Before
```
layout(set = 0, binding = 1) uniform PRECISION sampler3D image_in;
layout(set = 0, binding = 2) uniform PRECISION sampler3D image_other;
```
Input values were read incorrectly and got wild results.
```
ET-VK
tensor([[-2147483648, -2147483648, 0],
[-2147483648, 0, 0]], dtype=torch.int32)
Eager-mode
tensor([[-123, -131, 182],
[ -29, 24, 138]], dtype=torch.int32)
````
## After
```
layout(set = 0, binding = 1) uniform PRECISION ${SAMPLER_T[NDIM][DTYPE]} image_in;
layout(set = 0, binding = 2) uniform PRECISION ${SAMPLER_T[NDIM][DTYPE]} image_other;
```
OR modernize to the new layout generation functions, which already use and abstract `SAMPLER_T` to avoid the same future mistake.
```
${layout_declare_tensor(1, "r", "t_in", DTYPE, STORAGE)}
${layout_declare_tensor(2, "r", "t_other", DTYPE, STORAGE)}
```
ghstack-source-id: 227761995
Reviewed By: nathanaelsee
Differential Revision: D57731470
fbshipit-source-id: f233089e5b4ced6f3d47b90a9c84795cf62bb4de J
Jorge Pineda committed
9d4727d176cc5779a5d2d8dc60db043bf6b2e764
Parent: b8f92df
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 5/25/2024, 1:15:20 AM