| // 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/type/builtin_bench.cc.tmpl |
| // |
| // Do not modify this file directly |
| //////////////////////////////////////////////////////////////////////////////// |
| |
| #include "src/tint/type/builtin.h" |
| |
| #include <array> |
| |
| #include "benchmark/benchmark.h" |
| |
| namespace tint::type { |
| namespace { |
| |
| void BuiltinParser(::benchmark::State& state) { |
| const char* kStrings[] = { |
| "ccol", |
| "3", |
| "bVol", |
| "bool", |
| "1ool", |
| "bqoJ", |
| "bllo77", |
| "fppqH", |
| "", |
| "Gb", |
| "f16", |
| "f1vi", |
| "f8WW", |
| "fxx", |
| "fgg", |
| "X", |
| "332", |
| "f32", |
| "fE2", |
| "fPTT", |
| "dxx2", |
| "4432", |
| "iSVV2", |
| "RR2", |
| "i32", |
| "92", |
| "i3", |
| "VOR2", |
| "ma2xyf", |
| "llnarr2772f", |
| "mat24200", |
| "mat2x2f", |
| "a2oof", |
| "zz2x2f", |
| "miitppx1", |
| "mat2xXXh", |
| "9II5ann2x2h", |
| "mataSSrHHYh", |
| "mat2x2h", |
| "makkh", |
| "jatgRx", |
| "mb2x2", |
| "mat2xjf", |
| "at2x3f", |
| "q2x3f", |
| "mat2x3f", |
| "matNN3f", |
| "at23vv", |
| "QQt2x3f", |
| "maffxr", |
| "mat2xjh", |
| "mNNw2x38", |
| "mat2x3h", |
| "matx3h", |
| "mrrt2x3h", |
| "Gat2x3h", |
| "mat2x4FF", |
| "at2f", |
| "marrx4f", |
| "mat2x4f", |
| "t2x4f", |
| "Da2xJJf", |
| "ma84", |
| "m11k4", |
| "matx4h", |
| "maJx4h", |
| "mat2x4h", |
| "mat2c4h", |
| "mat2x4O", |
| "KK_atvvtt4h", |
| "xx83x2f", |
| "__qatF2", |
| "matqx2f", |
| "mat3x2f", |
| "33atOx2f", |
| "mtt63x9oQQ", |
| "ma3x66f", |
| "mtOxzz66", |
| "mat3yy2h", |
| "ZaHH2Z", |
| "mat3x2h", |
| "4WWt3q2h", |
| "mOO3x2h", |
| "oatY2h", |
| "matx", |
| "ma3xFf", |
| "at3x3w", |
| "mat3x3f", |
| "fGtxKf", |
| "matqKx3f", |
| "matmmxFf", |
| "at3x3h", |
| "mt3x3q", |
| "mat3xbb", |
| "mat3x3h", |
| "mi3x3h", |
| "maOO3xq", |
| "matTvvx3h", |
| "maFF3x4f", |
| "Pa00xQf", |
| "mPt3x4f", |
| "mat3x4f", |
| "ma773xss", |
| "RRCbb3x4f", |
| "mXXt3x4f", |
| "qaCC3xOOh", |
| "ma3s4L", |
| "mXt3x4h", |
| "mat3x4h", |
| "mat34h", |
| "qa3O4", |
| "mat3x22h", |
| "myzz40XX", |
| "matVViP", |
| "mannC2f", |
| "mat4x2f", |
| "atx2AHHq", |
| "mat4x2", |
| "fatK2f", |
| "ltgg2h", |
| "mat4xh", |
| "NTTtcx4h", |
| "mat4x2h", |
| "ma7ppl2h", |
| "mNNt4xg", |
| "uub4XX2h", |
| "matx3f", |
| "Qt883f", |
| "mt9q3f", |
| "mat4x3f", |
| "m11t4x3f", |
| "22at4iif", |
| "at4x377", |
| "m2t4xNh", |
| "mVVt4x3h", |
| "FaWW4w11h", |
| "mat4x3h", |
| "mawwx3h", |
| "Dat4x3h", |
| "mt4x3K", |
| "mat41PPhf", |
| "mat44f", |
| "mYYt4x4f", |
| "mat4x4f", |
| "mttHH4kk", |
| "mat4rr4f", |
| "WWas4x4f", |
| "Yt4x4h", |
| "mt4qfh", |
| "mav224xuh", |
| "mat4x4h", |
| "t4x4h", |
| "YYat4h", |
| "may4x4EYY", |
| "daplMor", |
| "samMMle", |
| "sampl55r", |
| "sampler", |
| "saNpe", |
| "sa3Ol33", |
| "s3mpler", |
| "Iamplercomparismn", |
| "sampleKrcompannison", |
| "samlr_copXXison", |
| "sampler_comparison", |
| "samplpLL_comparisI", |
| "smplerfomparison", |
| "sYmpURDr_comprison", |
| "texturh_depth_2d", |
| "teqtureuIIdep_2d", |
| "texture_depth_2H", |
| "texture_depth_2d", |
| "texre_depth_2Qvv", |
| "te66ue_depeh_2d", |
| "textue_d7pOh_2d", |
| "textureDDde0th_255_array", |
| "texture_IIepth_Hd_array", |
| "txture_depth_2d_array", |
| "texture_depth_2d_array", |
| "txture_depth_2r_array", |
| "tlxture_depth_2d_array", |
| "ttexturGdeth_2d_arrJJy", |
| "yexture_depth_cbe", |
| "texturedepth_cube", |
| "texture_IIeptBB_cube", |
| "texture_depth_cube", |
| "textKre_depth_c83TTe", |
| "texSnnYUUure_depth_cube", |
| "textuxe_5eptCCdZube", |
| "texturekkdepth_cube_arraq", |
| "exture_dppt00iicube5array", |
| "texIIurenndepth_cube_array", |
| "texture_depth_cube_array", |
| "ccextue_depth_cube_aKWa", |
| "texture_epth_cube_raKK", |
| "texture_depth_cube_a66ray", |
| "textEPPeKKdept_multisampled_2", |
| "texture_depth_mutisampledxx2d", |
| "texture_depth_qultisampled_2d", |
| "texture_depth_multisampled_2d", |
| "textureyydMMptr_mutisampleSS_2d", |
| "txture_depth_muluisampled2d", |
| "texSure_ept_mutisampled_2d", |
| "textu5e_externFFl", |
| "text44rrr_exterzal", |
| "texue_eWWtenal", |
| "texture_external", |
| "textuXe_ZZxtJJrnal", |
| "textuPPe_eternal", |
| "texturc_external", |
| "tllxture_storage_P6d", |
| "tex99ure_yytorag_1d", |
| "textuKKe_storage_1d", |
| "texture_storage_1d", |
| "texture__xorage_d", |
| "yxKur_storage_1d", |
| "textureVstorkge_1z", |
| "texKure_Storqge_2d", |
| "texture_storage_d", |
| "teture_storage_VVd", |
| "texture_storage_2d", |
| "textureIstoraAUe_2d", |
| "jextre_storaR_2d", |
| "extue44storYYge_2", |
| "textre_storage_2d_array", |
| "tex9ur_stor11ge_d_xxrray", |
| "tmmxture_storJe_2d_arrcc", |
| "texture_storage_2d_array", |
| "tJJxture_storage_2_array", |
| "DDCCltufe_storaUe_2d_array", |
| "tegture_storage_2d_array", |
| "exture_srageCC3d", |
| "txture_storage_3d", |
| "textuIe_sto__age_3d", |
| "texture_storage_3d", |
| "texttte_PPorage_3d", |
| "texture_stora3de_3d", |
| "exture_Ktoragyy_3d", |
| "", |
| "03nn", |
| "uCnuu", |
| "u32", |
| "3Xl", |
| "pp3o", |
| "uww", |
| "veuug", |
| "vaac", |
| "TRZcccf", |
| "vec2f", |
| "vTc2O8", |
| "vem02f", |
| "meBB2f", |
| "Mpp2", |
| "OOe2h", |
| "veG2G", |
| "vec2h", |
| "11eHH2h", |
| "veFFe6", |
| "ve2", |
| "vKii2l", |
| "ec2i", |
| "v992IIv", |
| "vec2i", |
| "veci", |
| "vechi", |
| "vczllPi", |
| "u", |
| "vffqq2", |
| "vJdd2u", |
| "vec2u", |
| "vecXX", |
| "ve22", |
| "Nyyc2u", |
| "vO3", |
| "PEruZ", |
| "vlc2edd", |
| "vec3f", |
| "ec9f", |
| "ve1II", |
| "veb3f", |
| "vi7", |
| "oec3ii", |
| "ec3", |
| "vec3h", |
| "veci", |
| "22ec", |
| "vGc3C", |
| "ffec38", |
| "c3i", |
| "JJecSSi", |
| "vec3i", |
| "93i", |
| "vbbJJ3TT", |
| "e66i", |
| "u663u", |
| "vW3u", |
| "v3u", |
| "vec3u", |
| "vecu", |
| "rec3u", |
| "2ec3B", |
| "vcBBf", |
| "vRc4f", |
| "v4LL0", |
| "vec4f", |
| "vKOOf", |
| "vgwcf", |
| "vLphf", |
| "eiiEh", |
| "ec4h", |
| "UU884", |
| "vec4h", |
| "rrecvvh", |
| "ecmm", |
| "vec4j", |
| "vec4X", |
| "vec48", |
| "vecvEE", |
| "vec4i", |
| "z99ci", |
| "GGeJJA4i", |
| "vess4i", |
| "vPcKu", |
| "tpc4u", |
| "vec", |
| "vec4u", |
| "MMec4u", |
| "vJJc40", |
| "8c", |
| }; |
| for (auto _ : state) { |
| for (auto* str : kStrings) { |
| auto result = ParseBuiltin(str); |
| benchmark::DoNotOptimize(result); |
| } |
| } |
| } |
| |
| BENCHMARK(BuiltinParser); |
| |
| } // namespace |
| } // namespace tint::type |