From b4a3673091c8b0ea549e30ed80ab4655e7487138 Mon Sep 17 00:00:00 2001 From: Jorge Pineda Date: Wed, 3 Apr 2024 19:35:46 -0700 Subject: [PATCH] [ET-VK][EZ] Fix comment style for parameter names TIL from the linter and @ssjia's code that this is bad style ``` get_val_or_inf(graph, args[1], /*max =*/false), ``` and this is good style: ``` get_val_or_inf(graph, args[1], /*max = */ false), ``` Differential Revision: [D55721203](https://our.internmc.facebook.com/intern/diff/D55721203/) [ghstack-poisoned] --- .../vulkan/runtime/graph/ops/impl/UnaryOp.cpp | 4 +- .../vulkan/test/vulkan_compute_api_test.cpp | 44 +++++++++++++++---- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/backends/vulkan/runtime/graph/ops/impl/UnaryOp.cpp b/backends/vulkan/runtime/graph/ops/impl/UnaryOp.cpp index 08b24801bc4..9960b6054d6 100644 --- a/backends/vulkan/runtime/graph/ops/impl/UnaryOp.cpp +++ b/backends/vulkan/runtime/graph/ops/impl/UnaryOp.cpp @@ -82,8 +82,8 @@ float get_val_or_inf(ComputeGraph& graph, const ValueRef& val, bool max) { return add_unary_op_node( \ graph, \ args[0], \ - get_val_or_inf(graph, args[1], /*max =*/false), \ - get_val_or_inf(graph, args[2], /*max =*/true), \ + get_val_or_inf(graph, args[1], /*max = */ false), \ + get_val_or_inf(graph, args[2], /*max = */ true), \ args[3], \ kClampShaderName); \ } diff --git a/backends/vulkan/test/vulkan_compute_api_test.cpp b/backends/vulkan/test/vulkan_compute_api_test.cpp index 28166502239..3a67e21fb44 100644 --- a/backends/vulkan/test/vulkan_compute_api_test.cpp +++ b/backends/vulkan/test/vulkan_compute_api_test.cpp @@ -1044,11 +1044,39 @@ void test_mm( } TEST(VulkanComputeGraphOpsTest, mm_smoke_test) { -#define RUN_TESTS(dtype, layout, prepack) \ - test_mm(/*B=*/1, /*M=*/31, /*K=*/127, /*N=*/23, dtype, layout, prepack); \ - test_mm(/*B=*/5, /*M=*/31, /*K=*/127, /*N=*/23, dtype, layout, prepack); \ - test_mm(/*B=*/7, /*M=*/13, /*K=*/89, /*N=*/17, dtype, layout, prepack); \ - test_mm(/*B=*/1, /*M=*/13, /*K=*/89, /*N=*/17, dtype, layout, prepack); +#define RUN_TESTS(dtype, layout, prepack) \ + test_mm( \ + /*B = */ 1, \ + /*M = */ 31, \ + /*K = */ 127, \ + /*N = */ 23, \ + dtype, \ + layout, \ + prepack); \ + test_mm( \ + /*B = */ 5, \ + /*M = */ 31, \ + /*K = */ 127, \ + /*N = */ 23, \ + dtype, \ + layout, \ + prepack); \ + test_mm( \ + /*B = */ 7, \ + /*M = */ 13, \ + /*K = */ 89, \ + /*N = */ 17, \ + dtype, \ + layout, \ + prepack); \ + test_mm( \ + /*B = */ 1, \ + /*M = */ 13, \ + /*K = */ 89, \ + /*N = */ 17, \ + dtype, \ + layout, \ + prepack); CALL_TEST_FN_FOR_W_PACKED(RUN_TESTS); CALL_TEST_FN_FOR_C_PACKED(RUN_TESTS); @@ -1102,7 +1130,7 @@ void test_max_pool2d( // Run graph - fill_vtensor(graph, graph.inputs().at(0), base_val, /*iota=*/true); + fill_vtensor(graph, graph.inputs().at(0), base_val, /*iota = */ true); vTensor& t_in = graph.get_val(in_ioval.value).toTensor(); std::vector input_data(t_in.gpu_numel()); @@ -1140,7 +1168,7 @@ void test_max_pool2d( TEST(VulkanComputeGraphOpsTest, max_pool2d_smoke_test) { std::vector kernel = {2, 3}; test_max_pool2d( - /*in_size=*/{1, 4, 6}, - /*base_val=*/10.0f, + /*in_size = */ {1, 4, 6}, + /*base_val = */ 10.0f, kernel); }