FastDeploy  latest
Fast & Easy to Deploy!
option.h
1 // Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #pragma once
16 
17 #include "fastdeploy/core/fd_type.h"
18 #include <iostream>
19 #include <memory>
20 #include <string>
21 #include <vector>
22 
23 namespace fastdeploy {
24 
28  Device device = Device::CPU;
29  int device_id = 0;
30  bool long_to_int = true;
31  // There is calculation precision in tf32 mode on A10, it can bring some
32  // performance improvement, but there may be diff
33  bool use_nvidia_tf32 = false;
34  // Threshold for the number of non-const ops
35  int32_t unconst_ops_thres = -1;
36  std::string poros_file = "";
37  std::vector<FDDataType> prewarm_datatypes = {FDDataType::FP32};
38  // TRT options
39  bool enable_fp16 = false;
40  bool enable_int8 = false;
41  bool is_dynamic = false;
42  size_t max_batch_size = 32;
43  size_t max_workspace_size = 1 << 30;
44 };
45 
46 } // namespace fastdeploy
Option object to configure Poros backend.
Definition: option.h:27
All C++ FastDeploy APIs are defined inside this namespace.
Definition: option.h:16