blob: f95f956f7a88baad18530b31c0f2d887d022e637 [file] [log] [blame]
Austin Engcc2516a2023-10-17 20:57:54 +00001// Copyright 2022 The Dawn & Tint Authors
Ben Claytona123b892022-07-27 16:36:35 +00002//
Austin Engcc2516a2023-10-17 20:57:54 +00003// Redistribution and use in source and binary forms, with or without
4// modification, are permitted provided that the following conditions are met:
Ben Claytona123b892022-07-27 16:36:35 +00005//
Austin Engcc2516a2023-10-17 20:57:54 +00006// 1. Redistributions of source code must retain the above copyright notice, this
7// list of conditions and the following disclaimer.
Ben Claytona123b892022-07-27 16:36:35 +00008//
Austin Engcc2516a2023-10-17 20:57:54 +00009// 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 Claytona123b892022-07-27 16:36:35 +000027
28////////////////////////////////////////////////////////////////////////////////
Ben Clayton57ded6a2023-08-22 13:22:22 +000029// File generated by 'tools/src/cmd/gen' using the template:
Ben Claytoncd52f382023-08-07 13:11:08 +000030// src/tint/lang/core/address_space_bench.cc.tmpl
Ben Claytona123b892022-07-27 16:36:35 +000031//
Ben Clayton57ded6a2023-08-22 13:22:22 +000032// To regenerate run: './tools/run gen'
33//
34// Do not modify this file directly
Ben Claytona123b892022-07-27 16:36:35 +000035////////////////////////////////////////////////////////////////////////////////
36
Ben Claytoncd52f382023-08-07 13:11:08 +000037#include "src/tint/lang/core/address_space.h"
Ben Claytona123b892022-07-27 16:36:35 +000038
39#include <array>
40
41#include "benchmark/benchmark.h"
42
Ben Claytoncd52f382023-08-07 13:11:08 +000043namespace tint::core {
Ben Claytona123b892022-07-27 16:36:35 +000044namespace {
45
dan sinclairff7cf212022-10-03 14:05:23 +000046void AddressSpaceParser(::benchmark::State& state) {
Ben Claytoned3389f2023-02-09 23:56:42 +000047 const char* kStrings[] = {
Ben Clayton79781f22023-02-18 17:13:18 +000048 "ccin",
49 "3",
50 "_Vin",
51 "__in",
52 "1_in",
53 "_qiJ",
54 "_lli77",
55 "__qHupp",
56 "vt",
57 "G_bt",
58 "__out",
59 "__viut",
60 "__8WWt",
61 "Mxxou",
62 "fuXggton",
63 "fuXtou",
64 "funct3on",
65 "function",
66 "funEtion",
67 "PPncTTion",
68 "xxuncddon",
Ben Clayton6cd15d22023-09-06 10:41:09 +000069 "pixe44_local",
70 "SSVVxel_local",
71 "pixRR_local",
72 "pixel_local",
73 "pixel_lF9a",
74 "pixel_loca",
75 "pOOxVRl_locH",
76 "prvaye",
77 "llnrrrv77te",
78 "priv4t00",
Ben Clayton79781f22023-02-18 17:13:18 +000079 "private",
Ben Clayton6cd15d22023-09-06 10:41:09 +000080 "rvooe",
81 "zzvate",
82 "piiippa1",
83 "puXXh_constant",
84 "pusII9_nn55nstant",
85 "YusHH_coaastSSrnt",
Ben Clayton79781f22023-02-18 17:13:18 +000086 "push_constant",
Ben Clayton6cd15d22023-09-06 10:41:09 +000087 "pushonkkHan",
88 "jush_consgRt",
89 "puh_cobsant",
90 "storaje",
91 "torage",
92 "qrage",
Ben Clayton79781f22023-02-18 17:13:18 +000093 "storage",
Ben Clayton6cd15d22023-09-06 10:41:09 +000094 "stoNNge",
95 "torgvv",
96 "QQorage",
97 "unffor",
Ben Clayton79781f22023-02-18 17:13:18 +000098 "unifojm",
Ben Clayton6cd15d22023-09-06 10:41:09 +000099 "uNNwfor8",
Ben Clayton79781f22023-02-18 17:13:18 +0000100 "uniform",
Ben Clayton6cd15d22023-09-06 10:41:09 +0000101 "uniorm",
102 "urriform",
103 "Gniform",
104 "workgrFFup",
105 "Eokgru",
106 "worrgroup",
Ben Clayton79781f22023-02-18 17:13:18 +0000107 "workgroup",
Ben Clayton6cd15d22023-09-06 10:41:09 +0000108 "wokgrou",
109 "woJDkgoup",
110 "okroup",
Ben Claytona123b892022-07-27 16:36:35 +0000111 };
112 for (auto _ : state) {
Ben Claytoned3389f2023-02-09 23:56:42 +0000113 for (auto* str : kStrings) {
dan sinclairff7cf212022-10-03 14:05:23 +0000114 auto result = ParseAddressSpace(str);
Ben Claytona123b892022-07-27 16:36:35 +0000115 benchmark::DoNotOptimize(result);
116 }
117 }
Ben Clayton47dd3012023-04-26 18:27:53 +0000118} // NOLINT(readability/fn_size)
Ben Claytona123b892022-07-27 16:36:35 +0000119
dan sinclairff7cf212022-10-03 14:05:23 +0000120BENCHMARK(AddressSpaceParser);
Ben Claytona123b892022-07-27 16:36:35 +0000121
122} // namespace
Ben Claytoncd52f382023-08-07 13:11:08 +0000123} // namespace tint::core