diff --git a/backends/vulkan/op_registry.py b/backends/vulkan/op_registry.py index 6f4cd9b8978..461aeeaafcc 100644 --- a/backends/vulkan/op_registry.py +++ b/backends/vulkan/op_registry.py @@ -248,7 +248,7 @@ def register_clamp(): # ============================================================================= -# BinaryOp.cpp +# binary/BinaryOp.cpp # ============================================================================= @@ -302,7 +302,7 @@ def register_comparison_ops(): # ============================================================================= -# BinaryOp.cpp (bitwise) +# binary/BinaryOp.cpp (bitwise) # ============================================================================= @@ -325,7 +325,7 @@ def register_bool_binary_ops(): # ============================================================================= -# BinaryScalarOp.cpp +# binary/BinaryScalarOp.cpp # ============================================================================= @@ -627,7 +627,7 @@ def register_torchao_choose_qparams_affine(): # ============================================================================= -# Q8taBinary.cpp +# binary/q8ta/Q8taBinary.cpp # ============================================================================= diff --git a/backends/vulkan/runtime/graph/ops/glsl/binary_op_buffer.glsl b/backends/vulkan/runtime/graph/ops/glsl/binary/binary_op_buffer.glsl similarity index 100% rename from backends/vulkan/runtime/graph/ops/glsl/binary_op_buffer.glsl rename to backends/vulkan/runtime/graph/ops/glsl/binary/binary_op_buffer.glsl diff --git a/backends/vulkan/runtime/graph/ops/glsl/binary_op_buffer.yaml b/backends/vulkan/runtime/graph/ops/glsl/binary/binary_op_buffer.yaml similarity index 100% rename from backends/vulkan/runtime/graph/ops/glsl/binary_op_buffer.yaml rename to backends/vulkan/runtime/graph/ops/glsl/binary/binary_op_buffer.yaml diff --git a/backends/vulkan/runtime/graph/ops/glsl/binary_op_defs.glslh b/backends/vulkan/runtime/graph/ops/glsl/binary/binary_op_defs.glslh similarity index 100% rename from backends/vulkan/runtime/graph/ops/glsl/binary_op_defs.glslh rename to backends/vulkan/runtime/graph/ops/glsl/binary/binary_op_defs.glslh diff --git a/backends/vulkan/runtime/graph/ops/glsl/binary_op_texture.glsl b/backends/vulkan/runtime/graph/ops/glsl/binary/binary_op_texture.glsl similarity index 100% rename from backends/vulkan/runtime/graph/ops/glsl/binary_op_texture.glsl rename to backends/vulkan/runtime/graph/ops/glsl/binary/binary_op_texture.glsl diff --git a/backends/vulkan/runtime/graph/ops/glsl/binary_op_texture.yaml b/backends/vulkan/runtime/graph/ops/glsl/binary/binary_op_texture.yaml similarity index 100% rename from backends/vulkan/runtime/graph/ops/glsl/binary_op_texture.yaml rename to backends/vulkan/runtime/graph/ops/glsl/binary/binary_op_texture.yaml diff --git a/backends/vulkan/runtime/graph/ops/glsl/binary_scalar_buffer.glsl b/backends/vulkan/runtime/graph/ops/glsl/binary/binary_scalar_buffer.glsl similarity index 100% rename from backends/vulkan/runtime/graph/ops/glsl/binary_scalar_buffer.glsl rename to backends/vulkan/runtime/graph/ops/glsl/binary/binary_scalar_buffer.glsl diff --git a/backends/vulkan/runtime/graph/ops/glsl/binary_scalar_buffer.yaml b/backends/vulkan/runtime/graph/ops/glsl/binary/binary_scalar_buffer.yaml similarity index 100% rename from backends/vulkan/runtime/graph/ops/glsl/binary_scalar_buffer.yaml rename to backends/vulkan/runtime/graph/ops/glsl/binary/binary_scalar_buffer.yaml diff --git a/backends/vulkan/runtime/graph/ops/glsl/binary_scalar_texture.glsl b/backends/vulkan/runtime/graph/ops/glsl/binary/binary_scalar_texture.glsl similarity index 100% rename from backends/vulkan/runtime/graph/ops/glsl/binary_scalar_texture.glsl rename to backends/vulkan/runtime/graph/ops/glsl/binary/binary_scalar_texture.glsl diff --git a/backends/vulkan/runtime/graph/ops/glsl/binary_scalar_texture.yaml b/backends/vulkan/runtime/graph/ops/glsl/binary/binary_scalar_texture.yaml similarity index 100% rename from backends/vulkan/runtime/graph/ops/glsl/binary_scalar_texture.yaml rename to backends/vulkan/runtime/graph/ops/glsl/binary/binary_scalar_texture.yaml diff --git a/backends/vulkan/runtime/graph/ops/glsl/q8ta_binary.glsl b/backends/vulkan/runtime/graph/ops/glsl/binary/q8ta/q8ta_binary.glsl similarity index 100% rename from backends/vulkan/runtime/graph/ops/glsl/q8ta_binary.glsl rename to backends/vulkan/runtime/graph/ops/glsl/binary/q8ta/q8ta_binary.glsl diff --git a/backends/vulkan/runtime/graph/ops/glsl/q8ta_binary.yaml b/backends/vulkan/runtime/graph/ops/glsl/binary/q8ta/q8ta_binary.yaml similarity index 100% rename from backends/vulkan/runtime/graph/ops/glsl/q8ta_binary.yaml rename to backends/vulkan/runtime/graph/ops/glsl/binary/q8ta/q8ta_binary.yaml diff --git a/backends/vulkan/runtime/graph/ops/impl/BinaryOp.cpp b/backends/vulkan/runtime/graph/ops/impl/binary/BinaryOp.cpp similarity index 100% rename from backends/vulkan/runtime/graph/ops/impl/BinaryOp.cpp rename to backends/vulkan/runtime/graph/ops/impl/binary/BinaryOp.cpp diff --git a/backends/vulkan/runtime/graph/ops/impl/BinaryScalarOp.cpp b/backends/vulkan/runtime/graph/ops/impl/binary/BinaryScalarOp.cpp similarity index 100% rename from backends/vulkan/runtime/graph/ops/impl/BinaryScalarOp.cpp rename to backends/vulkan/runtime/graph/ops/impl/binary/BinaryScalarOp.cpp diff --git a/backends/vulkan/runtime/graph/ops/impl/Q8taBinary.cpp b/backends/vulkan/runtime/graph/ops/impl/binary/q8ta/Q8taBinary.cpp similarity index 100% rename from backends/vulkan/runtime/graph/ops/impl/Q8taBinary.cpp rename to backends/vulkan/runtime/graph/ops/impl/binary/q8ta/Q8taBinary.cpp diff --git a/backends/vulkan/runtime/graph/ops/impl/Q8taBinary.h b/backends/vulkan/runtime/graph/ops/impl/binary/q8ta/Q8taBinary.h similarity index 100% rename from backends/vulkan/runtime/graph/ops/impl/Q8taBinary.h rename to backends/vulkan/runtime/graph/ops/impl/binary/q8ta/Q8taBinary.h diff --git a/backends/vulkan/test/custom_ops/impl/TestQ8taBinary.cpp b/backends/vulkan/test/custom_ops/impl/TestQ8taBinary.cpp index e3c3e6e2642..00b042c8180 100644 --- a/backends/vulkan/test/custom_ops/impl/TestQ8taBinary.cpp +++ b/backends/vulkan/test/custom_ops/impl/TestQ8taBinary.cpp @@ -9,8 +9,8 @@ #include #include -#include #include +#include namespace vkcompute { diff --git a/backends/vulkan/test/test_vulkan_shader_names.py b/backends/vulkan/test/test_vulkan_shader_names.py index 1535e6c9653..d7843a075e2 100644 --- a/backends/vulkan/test/test_vulkan_shader_names.py +++ b/backends/vulkan/test/test_vulkan_shader_names.py @@ -24,6 +24,7 @@ """ import importlib.util +import os import re import unittest from pathlib import Path @@ -42,7 +43,12 @@ _spec.loader.exec_module(gen_vulkan_spv) # The yaml templates whose variants `add_binary_op_node` dispatches into. -_BINARY_TEMPLATES = ("binary_op_buffer", "binary_op_texture") +_BINARY_BUFFER_TEMPLATE = os.path.join("binary", "binary_op_buffer") +_BINARY_TEXTURE_TEMPLATE = os.path.join("binary", "binary_op_texture") +_BINARY_TEMPLATES = ( + _BINARY_BUFFER_TEMPLATE, + _BINARY_TEXTURE_TEMPLATE, +) def _function_body(text: str, name: str) -> str: @@ -113,8 +119,8 @@ def test_int32_eq_shaders_are_named_for_the_dispatcher(self) -> None: build. Kokoro's synthesizer aborted on it. """ for template, expected in ( - ("binary_op_buffer", "binary_eq_buffer_int32"), - ("binary_op_texture", "binary_eq_texture3d_int32"), + (_BINARY_BUFFER_TEMPLATE, "binary_eq_buffer_int32"), + (_BINARY_TEXTURE_TEMPLATE, "binary_eq_texture3d_int32"), ): with self.subTest(template=template): self.assertIn(expected, self.names[template])