Skip to content

Commit 24b31a9

Browse files
protobird-gitcopybara-github
authored andcommitted
Pass webgpu instance & proc table from gpu.so to sampler.so
LiteRT-PiperOrigin-RevId: 819940925
1 parent 5f3837e commit 24b31a9

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

litert/c/litert_environment_options.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ typedef enum {
4545
kLiteRtEnvOptionTagMagicNumberConfigs = 16,
4646
kLiteRtEnvOptionTagMagicNumberVerifications = 17,
4747
kLiteRtEnvOptionTagCompilerCacheDir = 18,
48+
// Singleton ML Drift WebGPU/Dawn instance required for shared libraries not
49+
// to create their own instances.
50+
kLiteRtEnvOptionTagWebGpuInstance = 19,
51+
// Dawn procedure table pointer for shared libraries to populate their tables
52+
// with the shared procedures instead of their own procedures.
53+
kLiteRtEnvOptionTagWebGpuProcs = 20,
4854
} LiteRtEnvOptionTag;
4955

5056
typedef struct {

litert/cc/litert_environment.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ class Environment
5757
MagicNumberConfigs = kLiteRtEnvOptionTagMagicNumberConfigs,
5858
MagicNumberVerifications = kLiteRtEnvOptionTagMagicNumberVerifications,
5959
CompilerCacheDir = kLiteRtEnvOptionTagCompilerCacheDir,
60+
WebGpuInstance = kLiteRtEnvOptionTagWebGpuInstance,
61+
WebGpuProcs = kLiteRtEnvOptionTagWebGpuProcs,
6062
};
6163

6264
struct Option {

0 commit comments

Comments
 (0)