Caffe2 - C++ API
A deep learning, cross platform ML framework
ImageAllocator.h
1 
2 #pragma once
3 
4 #include "GLImageAllocator.h"
5 
6 namespace caffe2 {
7 
8 template <class T>
10  GLImageAllocator<T>* glImageAllocator;
11 
12  public:
14 
15  virtual ~ImageAllocator() { delete glImageAllocator; }
16 
17  GLImageVector<T>* newImage(
18  int num_images, int width, int height, int channels, bool is_output = false) {
19  const int tile_x = 1, tile_y = 1;
20  return glImageAllocator->newImage(
21  num_images, width, height, channels, tile_x, tile_y, is_output);
22  }
23 
24  GLImageVector<T>* newImage(int num_images,
25  int width,
26  int height,
27  int channels,
28  int tile_x,
29  int tile_y,
30  bool is_output = false) {
31  return glImageAllocator->newImage(
32  num_images, width, height, channels, tile_x, tile_y, is_output);
33  }
34 
35  GLImageVector<T>* newImage(
36  int num_images,
37  int width,
38  int height,
39  int channels,
40  int tile_x,
41  int tile_y,
42  std::function<const GLTexture*(const int width, const int height)> textureAllocator) {
43  return glImageAllocator->newImage(
44  num_images, width, height, channels, tile_x, tile_y, textureAllocator);
45  }
46 };
47 } // namespace caffe2
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...