| // Copyright 2022 The Tint Authors. |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| //////////////////////////////////////////////////////////////////////////////// |
| // File generated by tools/src/cmd/gen |
| // using the template: |
| // src/tint/lang/core/builtin_value_bench.cc.tmpl |
| // |
| // Do not modify this file directly |
| //////////////////////////////////////////////////////////////////////////////// |
| |
| #include "src/tint/lang/core/builtin_value.h" |
| |
| #include <array> |
| |
| #include "benchmark/benchmark.h" |
| |
| namespace tint::core { |
| namespace { |
| |
| void BuiltinValueParser(::benchmark::State& state) { |
| const char* kStrings[] = { |
| "_ccpoint_siz", |
| "_3poi_ile", |
| "__poiVt_size", |
| "__point_size", |
| "1_point_size", |
| "__pointJsqze", |
| "__lloint_siz77", |
| "frqqgppepHHh", |
| "fv_dcpt", |
| "frabGdeth", |
| "frag_depth", |
| "frag_veiith", |
| "fr8g_depWWh", |
| "Mragxxepth", |
| "ggroXtfacing", |
| "Vot_fuciXg", |
| "front_fac3ng", |
| "front_facing", |
| "front_fEcing", |
| "fronPPfaTTing", |
| "ddroxxtfacing", |
| "global_invocatio44_id", |
| "global_invocaSSioVV_id", |
| "22loRal_invoRtion_id", |
| "global_invocation_id", |
| "globalFinvoction_id", |
| "gloal_invocation_id", |
| "RRlHOOaV_invoction_id", |
| "instance_ydex", |
| "instGlr77cnn_index", |
| "instan04e_index", |
| "instance_index", |
| "insacoo_inex", |
| "izstane_index", |
| "nippance_in11ex", |
| "local_invXXcation_id", |
| "lIIcal_i5599ocation_inn", |
| "HHrrcal_inSSocation_Yaa", |
| "local_invocation_id", |
| "lokkal_invocatini", |
| "jocal_invocRRongid", |
| "local_inocatbon_i", |
| "local_injocation_index", |
| "local_invocatio_index", |
| "locl_invocqtion_ndex", |
| "local_invocation_index", |
| "localNNinvocaton_index", |
| "local_invocatin_ivvdx", |
| "locl_invocatioQQ_index", |
| "num_workgffus", |
| "num_workgroujs", |
| "num_wrkgNNwoup8", |
| "num_workgroups", |
| "numworkgroups", |
| "num_workrrroups", |
| "num_worGgroups", |
| "pFFsition", |
| "pEiio", |
| "prrsitio", |
| "position", |
| "sition", |
| "poJJDtin", |
| "poi8i", |
| "smpke11nde", |
| "samle_index", |
| "saple_Jndex", |
| "sample_index", |
| "cample_index", |
| "sample_indOx", |
| "savvKKl___inttex", |
| "sam8le_xx5k", |
| "sampqq__msk", |
| "sampleqmask", |
| "sample_mask", |
| "33amOe_mas66", |
| "samoott6QQmask", |
| "66mple_mask", |
| "subroup_invoOaxion_i6zz", |
| "subgroup_inyyocation_id", |
| "subgrup_invcatiZHH_id", |
| "subgroup_invocation_id", |
| "subgroqp_inWWoat44on_id", |
| "subgrou_inOOocation_id", |
| "suhgrup_invoYation_id", |
| "subroup_si", |
| "suFgoup_size", |
| "subgowp_size", |
| "subgroup_size", |
| "suffgKup_sie", |
| "KKubgroqp_size", |
| "subFroup3mmize", |
| "ertex_index", |
| "verteq_inex", |
| "verbx_indbbx", |
| "vertex_index", |
| "iertex_indx", |
| "veOOtexqidex", |
| "vertexvvindTTx", |
| "workFFroup_id", |
| "workgPfpQ00d", |
| "woPkgroup_id", |
| "workgroup_id", |
| "wosskgrup_i77", |
| "workgroup_bbRC", |
| "workgroup_iXX", |
| }; |
| for (auto _ : state) { |
| for (auto* str : kStrings) { |
| auto result = ParseBuiltinValue(str); |
| benchmark::DoNotOptimize(result); |
| } |
| } |
| } // NOLINT(readability/fn_size) |
| |
| BENCHMARK(BuiltinValueParser); |
| |
| } // namespace |
| } // namespace tint::core |