1616#define THIRD_PARTY_ODML_LITERT_LITERT_CC_OPTIONS_LITERT_GPU_OPTIONS_H_
1717
1818#include " litert/c/litert_common.h"
19- #include " litert/cc/litert_common.h"
2019#include " litert/cc/litert_expected.h"
2120#include " litert/cc/litert_opaque_options.h"
2221
@@ -36,26 +35,53 @@ class GpuOptions : public litert::OpaqueOptions {
3635 LiteRtStatus EnableInfiniteFloatCapping (bool enabled);
3736 LiteRtStatus EnableBenchmarkMode (bool enabled);
3837 LiteRtStatus EnableAllowSrcQuantizedFcConvOps (bool enabled);
39- LiteRtStatus SetDelegatePrecision (DelegatePrecision precision);
40- [[deprecated(" Use SetDelegatePrecision above instead." )]]
38+
39+ enum class Precision : int {
40+ kDefault = kLiteRtDelegatePrecisionDefault ,
41+ kFp16 = kLiteRtDelegatePrecisionFp16 ,
42+ kFp32 = kLiteRtDelegatePrecisionFp32 ,
43+ };
44+ Expected<void > SetPrecision (Precision precision);
45+ [[deprecated(" Use SetPrecision above instead." )]]
4146 LiteRtStatus SetDelegatePrecision (LiteRtDelegatePrecision precision);
42- LiteRtStatus SetDelegateBufferStorageType (
43- DelegateBufferStorageType type);
44- [[deprecated(" Use SetDelegateBufferStorageType above instead." )]]
47+
48+ enum class BufferStorageType : int {
49+ kDefault = kLiteRtDelegateBufferStorageTypeDefault ,
50+ kBuffer = kLiteRtDelegateBufferStorageTypeBuffer ,
51+ kTexture2D = kLiteRtDelegateBufferStorageTypeTexture2D ,
52+ };
53+ Expected<void > SetBufferStorageType (BufferStorageType type);
54+ [[deprecated(" Use SetBufferStorageType above instead." )]]
4555 LiteRtStatus SetBufferStorageType (LiteRtDelegateBufferStorageType type);
56+
4657 LiteRtStatus SetPreferTextureWeights (bool prefer_texture_weights);
4758 LiteRtStatus SetSerializationDir (const char * serialization_dir);
4859 LiteRtStatus SetModelCacheKey (const char * model_cache_key);
4960 LiteRtStatus SetSerializeProgramCache (bool serialize_program_cache);
5061 LiteRtStatus SetSerializeExternalTensors (bool serialize_external_tensors);
5162 LiteRtStatus EnableExternalTensorsMode (bool enabled);
5263 LiteRtStatus AddExternalTensorPattern (const char * pattern);
53- LiteRtStatus SetGpuBackend (GpuBackend backend);
54- [[deprecated(" Use SetGpuBackend above instead." )]]
64+
65+ enum class Backend : int {
66+ kAutomatic = kLiteRtGpuBackendAutomatic ,
67+ kOpenCl = kLiteRtGpuBackendOpenCl ,
68+ kWebGpu = kLiteRtGpuBackendWebGpu ,
69+ kOpenGl = kLiteRtGpuBackendOpenGl ,
70+ };
71+ Expected<void > SetBackend (Backend backend);
72+ [[deprecated(" Use SetBackend above instead." )]]
5573 LiteRtStatus SetGpuBackend (LiteRtGpuBackend backend);
56- LiteRtStatus SetGpuPriority (GpuPriority priority);
57- [[deprecated(" Use SetGpuPriority above instead." )]]
74+
75+ enum class Priority : int {
76+ kDefault = kLiteRtGpuPriorityDefault ,
77+ kLow = kLiteRtGpuPriorityLow ,
78+ kNormal = kLiteRtGpuPriorityNormal ,
79+ kHigh = kLiteRtGpuPriorityHigh ,
80+ };
81+ Expected<void > SetPriority (Priority priority);
82+ [[deprecated(" Use SetPriority above instead." )]]
5883 LiteRtStatus SetGpuPriority (LiteRtGpuPriority priority);
84+
5985 LiteRtStatus SetMadviseOriginalSharedTensors (
6086 bool madvise_original_shared_tensors);
6187};
0 commit comments