Caffe2 - C++ API
A deep learning, cross platform ML framework
gl_tiling_utils.h
1 #pragma once
2 #include <cmath>
3 
4 struct point {
5  int x;
6  int y;
7 };
8 
10  point tile_dims;
11  point tile_size;
12  int tiles;
13 };
14 
15 namespace caffe2 {
16 inline static void squareFactors(int N, int& r1, int& r2) {
17  int f = sqrt(N);
18 
19  if (f * f == N) {
20  r1 = r2 = f;
21  } else {
22  while (N % f != 0) {
23  f--;
24  }
25  r1 = N / f;
26  r2 = f;
27  }
28 }
29 
30 inline static void computeOutputTiles(int output_channels, int& output_tile_x, int& output_tile_y) {
31  squareFactors((output_channels + 3) / 4, output_tile_x, output_tile_y);
32 }
33 } // namespace caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...