Default constructor for options turns on all optimizations.
| 24 | |
| 25 | // Default constructor for options turns on all optimizations. |
| 26 | struct CompilationOptions { |
| 27 | // Allows to quantify tensors, downcast values, process in float16 etc. |
| 28 | bool allow_precision_loss = false; |
| 29 | |
| 30 | // When set few operations are fused into a single shader. Therefore, there |
| 31 | // will be less shaders, but each shader will become larger. |
| 32 | bool fuse_operations = true; |
| 33 | |
| 34 | // Parameters will be inlined into a shader. This in turn will generated more |
| 35 | // unique shaders where each will need to be compiled. |
| 36 | bool inline_parameters = false; |
| 37 | |
| 38 | // If true, shaders, that have auto-input and auto-output, will use a single |
| 39 | // object for reading and writing. |
| 40 | bool inline_objects = true; // TODO(akulik): unsupported |
| 41 | |
| 42 | // Can be only Textures or Buffers |
| 43 | ObjectType preferred_obj_type = ObjectType::UNKNOWN; |
| 44 | // User has an option to choose between textures and buffers. Textures work |
| 45 | // better on Adreno and buffers are better for Mali. |
| 46 | |
| 47 | // Chooses object type to represent intermediate tensors. Buffers have more |
| 48 | // efficient memory usage because they represent opaque memory blob, but |
| 49 | // textures work better on Adreno. |
| 50 | // TODO(akulik): may be better name? |
| 51 | ObjectType ref_obj_type = ObjectType::UNKNOWN; |
| 52 | |
| 53 | // If true, a user may change BATCH dimension at runtime. Otherwise, static |
| 54 | // batch size will be fixed during compile time. |
| 55 | // Dynamic mode uses less memory, while static mode may yield better |
| 56 | // performance for small models. |
| 57 | bool dynamic_batch = false; |
| 58 | |
| 59 | // Fuses consequent nodes which have auto output and auto input. |
| 60 | bool auto_input_fusion = true; |
| 61 | |
| 62 | // If true sampler2D and texelFetch will be used to access read only textures. |
| 63 | // This feature is not supported yet by the OpenGL runtime. |
| 64 | bool sampler_textures = false; |
| 65 | }; |
| 66 | |
| 67 | } // namespace gl |
| 68 | } // namespace gpu |