@@ -41,29 +41,97 @@ class QualcommOptions : public OpaqueOptions {
4141
4242 static Expected<QualcommOptions> Create ();
4343
44+ // This determines the logging level of all underlying qualcomm sdk libraries.
45+ // Does not effect litert logging. Defaults to INFO.
46+ enum class LogLevel : int {
47+ kOff = kLiteRtQualcommLogOff ,
48+ kError = kLiteRtQualcommLogLevelError ,
49+ kWarn = kLiteRtQualcommLogLevelWarn ,
50+ kInfo = kLiteRtQualcommLogLevelInfo ,
51+ kVerbose = kLiteRtQualcommLogLevelVerbose ,
52+ kDebug = kLiteRtQualcommLogLevelDebug ,
53+ };
54+
55+ void SetLogLevel (LogLevel log_level);
56+
57+ [[deprecated(" Use SetLogLevel(QualcommOptionsLogLevel) instead." )]]
4458 void SetLogLevel (LiteRtQualcommOptionsLogLevel log_level);
59+
60+ // TODO(b/454666070): Rename to GetLogLevel once the deprecated function is
61+ // removed.
62+ LogLevel GetLogLevelCC ();
63+
64+ [[deprecated(" Use GetLogLevelCC() instead." )]]
4565 LiteRtQualcommOptionsLogLevel GetLogLevel ();
4666
67+ // This option controls whether to convert a LiteRt operation to QNN
68+ // operations which are preferred by the HTP backend. Defaults to false.
69+ enum class HtpPerformanceMode : int {
70+ kDefault = kLiteRtQualcommHtpPerformanceModeDefault ,
71+ kSustainedHighPerformance =
72+ kLiteRtQualcommHtpPerformanceModeSustainedHighPerformance ,
73+ kBurst = kLiteRtQualcommHtpPerformanceModeBurst ,
74+ kHighPerformance = kLiteRtQualcommHtpPerformanceModeHighPerformance ,
75+ kPowerSaver = kLiteRtQualcommHtpPerformanceModePowerSaver ,
76+ kLowPowerSaver = kLiteRtQualcommHtpPerformanceModeLowPowerSaver ,
77+ kHighPowerSaver = kLiteRtQualcommHtpPerformanceModeHighPowerSaver ,
78+ kLowBalanced = kLiteRtQualcommHtpPerformanceModeLowBalanced ,
79+ kBalanced = kLiteRtQualcommHtpPerformanceModeBalanced ,
80+ kExtremePowerSaver = kLiteRtQualcommHtpPerformanceModeExtremePowerSaver ,
81+ };
82+
83+ void SetHtpPerformanceMode (HtpPerformanceMode htp_performance_mode);
84+
85+ [[deprecated(" Use SetLogLevel(QualcommOptionsLogLevel) instead." )]]
4786 void SetHtpPerformanceMode (
4887 LiteRtQualcommOptionsHtpPerformanceMode htp_performance_mode);
4988 LiteRtQualcommOptionsHtpPerformanceMode GetHtpPerformanceMode ();
5089
5190 void SetUseHtpPreference (bool use_htp_preference);
5291 bool GetUseHtpPreference ();
5392
93+ // This option controls whether to convert a quantized int16 model to a
94+ // quantized uint16 model. Defaults to false.
5495 void SetUseQint16AsQuint16 (bool use_qin16_as_quint16);
5596 bool GetUseQint16AsQuint16 ();
5697
98+ // Weight sharing indicates whether different subgraphs may share weight
99+ // tensors. This is only supported on x86 AOT. Defaults to false.
57100 void SetEnableWeightSharing (bool weight_sharing_enabled);
58101 bool GetEnableWeightSharing ();
59102
103+ // When using short conv hmx, one might have better performance, but
104+ // convolution that have short depth and/or weights that are not symmetric
105+ // could exhibit inaccurate results.
60106 void SetUseConvHMX (bool use_conv_hmx);
61107 bool GetUseConvHMX ();
62108
109+ // When using fold relu, one might have better performance. This optimization
110+ // is correct when quantization ranges for convolution are equal to or are
111+ // subset of the Relu operation.
63112 void SetUseFoldReLU (bool use_fold_relu);
64113 bool GetUseFoldReLU ();
65114
115+ // This option controls the profiling level. A higher level results in a more
116+ // detailed report after execution. Defaults to off.
117+ enum class Profiling : int {
118+ kOff = kLiteRtQualcommProfilingOff ,
119+ kBasic = kLiteRtQualcommProfilingBasic ,
120+ kDetailed = kLiteRtQualcommProfilingDetailed ,
121+ kLinting = kLiteRtQualcommProfilingLinting ,
122+ kOptrace = kLiteRtQualcommProfilingOptrace ,
123+ };
124+
125+ void SetProfiling (Profiling profiling);
126+
127+ [[deprecated(" Use SetProfiling(QualcommOptionsProfiling) instead." )]]
66128 void SetProfiling (LiteRtQualcommOptionsProfiling profiling);
129+
130+ // TODO(b/454666070): Rename to GetProfiling once the deprecated function is
131+ // removed.
132+ Profiling GetProfilingCC ();
133+
134+ [[deprecated(" Use GetProfilingCC() instead." )]]
67135 LiteRtQualcommOptionsProfiling GetProfiling ();
68136
69137 void SetDumpTensorIds (const std::vector<std::int32_t >& ids);
@@ -78,8 +146,25 @@ class QualcommOptions : public OpaqueOptions {
78146 void SetNumHvxThreads (std::uint32_t num_hvx_threads);
79147 std::uint32_t GetNumHvxThreads ();
80148
149+ enum class OptimizationLevel : int {
150+ kOptimizeForInference = kHtpOptimizeForInference ,
151+ kOptimizeForPrepare = kHtpOptimizeForPrepare ,
152+ kOptimizeForInferenceO3 = kHtpOptimizeForInferenceO3 ,
153+ };
154+
155+ void SetOptimizationLevel (OptimizationLevel optimization_level);
156+
157+ [[deprecated(
158+ " Use SetOptimizationLevel(QualcommOptionsOptimizationLevel) "
159+ " instead." )]]
81160 void SetOptimizationLevel (
82161 LiteRtQualcommOptionsOptimizationLevel optimization_level);
162+
163+ // TODO(b/454666070): Rename to GetOptimizationLevel once the deprecated
164+ // function is removed.
165+ OptimizationLevel GetOptimizationLevelCC ();
166+
167+ [[deprecated(" Use GetOptimizationLevelCC() instead." )]]
83168 LiteRtQualcommOptionsOptimizationLevel GetOptimizationLevel ();
84169
85170 private:
0 commit comments