Austin Eng | cc2516a | 2023-10-17 20:57:54 +0000 | [diff] [blame] | 1 | // Copyright 2022 The Dawn & Tint Authors |
Ben Clayton | f50d56a | 2022-07-27 18:32:19 +0000 | [diff] [blame] | 2 | // |
Austin Eng | cc2516a | 2023-10-17 20:57:54 +0000 | [diff] [blame] | 3 | // Redistribution and use in source and binary forms, with or without |
| 4 | // modification, are permitted provided that the following conditions are met: |
Ben Clayton | f50d56a | 2022-07-27 18:32:19 +0000 | [diff] [blame] | 5 | // |
Austin Eng | cc2516a | 2023-10-17 20:57:54 +0000 | [diff] [blame] | 6 | // 1. Redistributions of source code must retain the above copyright notice, this |
| 7 | // list of conditions and the following disclaimer. |
Ben Clayton | f50d56a | 2022-07-27 18:32:19 +0000 | [diff] [blame] | 8 | // |
Austin Eng | cc2516a | 2023-10-17 20:57:54 +0000 | [diff] [blame] | 9 | // 2. Redistributions in binary form must reproduce the above copyright notice, |
| 10 | // this list of conditions and the following disclaimer in the documentation |
| 11 | // and/or other materials provided with the distribution. |
| 12 | // |
| 13 | // 3. Neither the name of the copyright holder nor the names of its |
| 14 | // contributors may be used to endorse or promote products derived from |
| 15 | // this software without specific prior written permission. |
| 16 | // |
| 17 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 18 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 19 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 20 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| 21 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 22 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 23 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 24 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 25 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Ben Clayton | f50d56a | 2022-07-27 18:32:19 +0000 | [diff] [blame] | 27 | |
| 28 | //////////////////////////////////////////////////////////////////////////////// |
Ben Clayton | 57ded6a | 2023-08-22 13:22:22 +0000 | [diff] [blame] | 29 | // File generated by 'tools/src/cmd/gen' using the template: |
Ben Clayton | 1165389 | 2023-09-19 19:15:59 +0000 | [diff] [blame] | 30 | // src/tint/lang/wgsl/extension_bench.cc.tmpl |
Ben Clayton | f50d56a | 2022-07-27 18:32:19 +0000 | [diff] [blame] | 31 | // |
Ben Clayton | 57ded6a | 2023-08-22 13:22:22 +0000 | [diff] [blame] | 32 | // To regenerate run: './tools/run gen' |
| 33 | // |
| 34 | // Do not modify this file directly |
Ben Clayton | f50d56a | 2022-07-27 18:32:19 +0000 | [diff] [blame] | 35 | //////////////////////////////////////////////////////////////////////////////// |
| 36 | |
Ben Clayton | 1165389 | 2023-09-19 19:15:59 +0000 | [diff] [blame] | 37 | #include "src/tint/lang/wgsl/extension.h" |
Ben Clayton | f50d56a | 2022-07-27 18:32:19 +0000 | [diff] [blame] | 38 | |
| 39 | #include <array> |
| 40 | |
| 41 | #include "benchmark/benchmark.h" |
| 42 | |
Ben Clayton | 1165389 | 2023-09-19 19:15:59 +0000 | [diff] [blame] | 43 | namespace tint::wgsl { |
Ben Clayton | f50d56a | 2022-07-27 18:32:19 +0000 | [diff] [blame] | 44 | namespace { |
| 45 | |
| 46 | void ExtensionParser(::benchmark::State& state) { |
Ben Clayton | ed3389f | 2023-02-09 23:56:42 +0000 | [diff] [blame] | 47 | const char* kStrings[] = { |
Ben Clayton | db368f1 | 2022-10-11 18:26:18 +0000 | [diff] [blame] | 48 | "chromium_disableuniformiccy_analysis", |
| 49 | "chromil3_disable_unifority_analss", |
| 50 | "chromium_disable_Vniformity_analysis", |
| 51 | "chromium_disable_uniformity_analysis", |
| 52 | "chromium_dis1ble_uniformity_analysis", |
| 53 | "chromium_qqisable_unifomity_anaJysis", |
| 54 | "chrollium_disable_uniformity_analysi77", |
Jiawei Shao | 53c0fa9 | 2023-12-08 01:24:00 +0000 | [diff] [blame] | 55 | "cqqromium_eppperimental_framebuffe_fetcHH", |
| 56 | "chrmium_experimvntal_frcmebufer_ftch", |
| 57 | "chromium_expebimental_framGbufer_fetch", |
Ben Clayton | 3e56a38 | 2023-11-09 16:22:33 +0000 | [diff] [blame] | 58 | "chromium_experimental_framebuffer_fetch", |
Jiawei Shao | 53c0fa9 | 2023-12-08 01:24:00 +0000 | [diff] [blame] | 59 | "chromium_experimental_vramebuffeii_fetch", |
| 60 | "chro8WWum_experimental_framebuffer_fetch", |
| 61 | "chromium_eperimenxxMl_framebuffer_fetch", |
Ben Clayton | f468667 | 2024-01-17 11:06:59 +0000 | [diff] [blame] | 62 | "chromum_experimental_pixeX_loggal", |
| 63 | "chromium_expVrXmntal_ixel_local", |
| 64 | "3hromium_experimental_pixel_local", |
Ben Clayton | 74688c9 | 2023-09-05 13:35:35 +0000 | [diff] [blame] | 65 | "chromium_experimental_pixel_local", |
Ben Clayton | f468667 | 2024-01-17 11:06:59 +0000 | [diff] [blame] | 66 | "chromium_eEperimental_pixel_local", |
| 67 | "chTTomiu_experimentaPP_pixel_local", |
| 68 | "cxxromium_expddrimenal_pixel_local", |
| 69 | "c44romium_experimental_push_constant", |
| 70 | "chromium_experimental_pSSsVV_constant", |
| 71 | "chrom22Rm_experimental_pushRonstant", |
dan sinclair | 4abf28e | 2022-08-02 15:55:35 +0000 | [diff] [blame] | 72 | "chromium_experimental_push_constant", |
Ben Clayton | f468667 | 2024-01-17 11:06:59 +0000 | [diff] [blame] | 73 | "chromium_exp9rimFntal_ush_constant", |
| 74 | "chrmium_experimental_push_constant", |
| 75 | "cOOromium_experiVeHtal_puh_conRRtant", |
| 76 | "chromium_eperimental_sybgroups", |
| 77 | "chrorri77mGexperimllntal_subgrnnups", |
| 78 | "chromium_exp4rimen00al_subgroups", |
James Price | 3b97fc4 | 2023-08-01 08:08:34 +0000 | [diff] [blame] | 79 | "chromium_experimental_subgroups", |
Ben Clayton | f468667 | 2024-01-17 11:06:59 +0000 | [diff] [blame] | 80 | "chromium_exprimenal_ubgrouoos", |
| 81 | "chrmiumexperimenzzal_subgroups", |
| 82 | "chrmi11m_experppmeiita_subgroups", |
Jiawei Shao | cd4bf9a | 2024-06-06 01:17:28 +0000 | [diff] [blame] | 83 | "chXXomium_internal_graphite", |
| 84 | "chromi55m_internnal_gra99hiIIe", |
| 85 | "chSSomiuY_internal_aarHHphrrte", |
Ben Clayton | e4d210d | 2024-02-26 17:08:02 +0000 | [diff] [blame] | 86 | "chromium_internal_graphite", |
Jiawei Shao | cd4bf9a | 2024-06-06 01:17:28 +0000 | [diff] [blame] | 87 | "kkhromium_nternal_rahHte", |
| 88 | "chromium_nRegnaj_graphite", |
| 89 | "chromium_ntebnal_gaphite", |
| 90 | "chromium_internal_input_atjachments", |
| 91 | "chromium_internal_inpt_attachments", |
| 92 | "chromium_nteral_iqput_attachments", |
Le Hoang Quyen | f9a9918 | 2024-05-22 21:02:35 +0000 | [diff] [blame] | 93 | "chromium_internal_input_attachments", |
Jiawei Shao | cd4bf9a | 2024-06-06 01:17:28 +0000 | [diff] [blame] | 94 | "chromium_internal_input_aNNtachents", |
| 95 | "chromium_internalinpt_attavvhments", |
| 96 | "chromium_internal_inut_attacQQments", |
| 97 | "chromirm_intenal_rfflaxed_unifrm_layout", |
| 98 | "chromium_internal_jelaxed_uniform_layout", |
| 99 | "chromium_interna_relNNxed_uwwiform_lay82t", |
James Price | 0b3400c | 2023-02-27 18:39:20 +0000 | [diff] [blame] | 100 | "chromium_internal_relaxed_uniform_layout", |
Jiawei Shao | cd4bf9a | 2024-06-06 01:17:28 +0000 | [diff] [blame] | 101 | "chromium_internal_relaxed_uniform_layut", |
| 102 | "chromium_internal_relaxed_rrniform_layout", |
| 103 | "chromium_internal_relaxedGuniform_layout", |
| 104 | "dual_source_blendFFng", |
| 105 | "dEl_surce_bending", |
| 106 | "drra_source_blending", |
Jiawei Shao | cc43f15 | 2024-05-29 00:44:43 +0000 | [diff] [blame] | 107 | "dual_source_blending", |
Jiawei Shao | cd4bf9a | 2024-06-06 01:17:28 +0000 | [diff] [blame] | 108 | "dual_suce_blending", |
| 109 | "dul_DoXrcJJ_blending", |
| 110 | "dul_source_lening", |
| 111 | "k", |
| 112 | "16", |
| 113 | "J1", |
Ben Clayton | db368f1 | 2022-10-11 18:26:18 +0000 | [diff] [blame] | 114 | "f16", |
Jiawei Shao | cd4bf9a | 2024-06-06 01:17:28 +0000 | [diff] [blame] | 115 | "c16", |
| 116 | "fO6", |
| 117 | "_KKttvv", |
James Price | 32950eb | 2024-06-26 11:25:37 +0000 | [diff] [blame] | 118 | "xubgro5p8", |
| 119 | "suFq__ups", |
| 120 | "sqqgroups", |
| 121 | "subgroups", |
| 122 | "subgr6u33O", |
| 123 | "s96grQttupoo", |
| 124 | "sugro66ps", |
| 125 | "ubgrxupszzO166", |
| 126 | "suyygroups_f16", |
| 127 | "sHHbgroups_Z", |
| 128 | "subgroups_f16", |
| 129 | "ubgWWou44q_f16", |
| 130 | "sOObgroup_f16", |
| 131 | "suboruph_Y16", |
Ben Clayton | f50d56a | 2022-07-27 18:32:19 +0000 | [diff] [blame] | 132 | }; |
| 133 | for (auto _ : state) { |
Ben Clayton | ed3389f | 2023-02-09 23:56:42 +0000 | [diff] [blame] | 134 | for (auto* str : kStrings) { |
Ben Clayton | f50d56a | 2022-07-27 18:32:19 +0000 | [diff] [blame] | 135 | auto result = ParseExtension(str); |
| 136 | benchmark::DoNotOptimize(result); |
| 137 | } |
| 138 | } |
Ben Clayton | 47dd301 | 2023-04-26 18:27:53 +0000 | [diff] [blame] | 139 | } // NOLINT(readability/fn_size) |
Ben Clayton | f50d56a | 2022-07-27 18:32:19 +0000 | [diff] [blame] | 140 | |
| 141 | BENCHMARK(ExtensionParser); |
| 142 | |
| 143 | } // namespace |
Ben Clayton | 1165389 | 2023-09-19 19:15:59 +0000 | [diff] [blame] | 144 | } // namespace tint::wgsl |