• Home
  • Raw
  • Download

Lines Matching full:shape

202 struct Shape {  struct
208 bool operator==(const Shape& s1, const Shape& s2) { in operator ==() argument
212 bool operator<(const Shape& shape1, const Shape& shape2) { in operator <()
223 float benchmark(const Shape& shape) { in benchmark() argument
234 shape.rows, shape.depth, shape.cols); in benchmark()
240 shape.rows, shape.depth, shape.cols); in benchmark()
245 shape.rows, shape.depth, shape.cols); in benchmark()
250 shape.rows, shape.depth, shape.cols); in benchmark()
252 return benchmark_float(shape.rows, shape.depth, shape.cols); in benchmark()
277 std::vector<Shape> all_shapes_in_random_order() { in all_shapes_in_random_order()
278 std::vector<Shape> shapes; in all_shapes_in_random_order()
281 // Benchmark one specific shape in all_shapes_in_random_order()
282 Shape shape; in all_shapes_in_random_order() local
283 shape.rows = BENCHMARK_ROWS; in all_shapes_in_random_order()
284 shape.depth = BENCHMARK_DEPTH; in all_shapes_in_random_order()
285 shape.cols = BENCHMARK_COLS; in all_shapes_in_random_order()
286 shapes.push_back(shape); in all_shapes_in_random_order()
290 Shape shape; in all_shapes_in_random_order() local
291 shape.rows = size; in all_shapes_in_random_order()
292 shape.depth = size; in all_shapes_in_random_order()
293 shape.cols = size; in all_shapes_in_random_order()
294 shapes.push_back(shape); in all_shapes_in_random_order()
301 Shape shape; in all_shapes_in_random_order() local
302 shape.rows = rows; in all_shapes_in_random_order()
303 shape.depth = depth; in all_shapes_in_random_order()
304 shape.cols = cols; in all_shapes_in_random_order()
305 shapes.push_back(shape); in all_shapes_in_random_order()
316 void run_benchmarks(std::map<Shape, float>* results) { in run_benchmarks() argument
317 std::vector<Shape> shapes; in run_benchmarks()
319 const std::vector<Shape> pass_shapes = all_shapes_in_random_order(); in run_benchmarks()
335 const Shape& shape = shapes[i]; in run_benchmarks() local
336 float latency = benchmark(shape); in run_benchmarks()
337 if (results->count(shape)) { in run_benchmarks()
338 (*results)[shape] = std::min(latency, (*results)[shape]); in run_benchmarks()
340 (*results)[shape] = latency; in run_benchmarks()
347 std::map<Shape, float> results; in main()
352 const Shape& shape = result.first; in main() local
353 printf("%d,%d,%d,%.4g,%.4g\n", shape.depth, shape.rows, shape.cols, in main()
355 2e-9 * shape.depth * shape.rows * shape.cols / result.second); in main()