@@ -60,36 +60,17 @@ using AOTInductorModelContainerRunFunc = AOTIRuntimeError (*)(
6060 AOTInductorStreamHandle stream_handle,
6161 AOTIProxyExecutorHandle proxy_executor_handle);
6262
63- // Global function pointers (will be loaded dynamically)
64- extern AOTInductorModelContainerCreateWithDeviceFunc
65- AOTInductorModelContainerCreateWithDevice;
66- extern AOTInductorModelContainerDeleteFunc AOTInductorModelContainerDelete;
67- extern AOTInductorModelContainerGetNumInputsFunc
68- AOTInductorModelContainerGetNumInputs;
69- extern AOTInductorModelContainerGetNumOutputsFunc
70- AOTInductorModelContainerGetNumOutputs;
71- extern AOTInductorModelContainerRunFunc AOTInductorModelContainerRun;
72-
7363// Retrieves the name of an input tensor by index from the AOTI model container.
74- // Needed by Metal backend
7564using AOTInductorModelContainerGetInputNameFunc = AOTIRuntimeError (*)(
7665 AOTInductorModelContainerHandle container_handle,
7766 size_t input_idx,
7867 const char ** input_name);
7968
8069// Retrieves the number of constants from the AOTI model container.
81- // Needed by Metal backend
8270using AOTInductorModelContainerGetNumConstantsFunc = AOTIRuntimeError (*)(
8371 AOTInductorModelContainerHandle container_handle,
8472 size_t * num_constants);
8573
86- // Global function pointers (will be loaded dynamically).
87- // Needed by Metal backend
88- extern AOTInductorModelContainerGetInputNameFunc
89- AOTInductorModelContainerGetInputName;
90- extern AOTInductorModelContainerGetNumConstantsFunc
91- AOTInductorModelContainerGetNumConstants;
92-
9374} // extern "C"
9475
9576// AOTI Delegate Handle structure
@@ -99,6 +80,13 @@ struct AOTIDelegateHandle {
9980 AOTInductorModelContainerHandle container_handle;
10081 void * cuda_stream; // cudaStream_t stored as void* to avoid CUDA header
10182 // dependency
83+
84+ // Function pointers specific to this handle's shared library
85+ AOTInductorModelContainerCreateWithDeviceFunc create_with_device;
86+ AOTInductorModelContainerDeleteFunc delete_container;
87+ AOTInductorModelContainerGetNumInputsFunc get_num_inputs;
88+ AOTInductorModelContainerGetNumOutputsFunc get_num_outputs;
89+ AOTInductorModelContainerRunFunc run;
10290};
10391
10492} // namespace aoti
0 commit comments