File tree Expand file tree Collapse file tree 4 files changed +30
-0
lines changed Expand file tree Collapse file tree 4 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,12 @@ AOTInductorModelContainerGetNumOutputsFunc
2525    AOTInductorModelContainerGetNumOutputs = nullptr ;
2626AOTInductorModelContainerRunFunc AOTInductorModelContainerRun = nullptr ;
2727
28+ //  Global function pointers needed by Metal backend
29+ AOTInductorModelContainerGetInputNameFunc
30+     AOTInductorModelContainerGetInputName = nullptr ;
31+ AOTInductorModelContainerGetNumConstantsFunc
32+     AOTInductorModelContainerGetNumConstants = nullptr ;
33+ 
2834} //  extern "C"
2935
3036} //  namespace aoti
Original file line number Diff line number Diff line change @@ -70,6 +70,22 @@ extern AOTInductorModelContainerGetNumOutputsFunc
7070    AOTInductorModelContainerGetNumOutputs;
7171extern  AOTInductorModelContainerRunFunc AOTInductorModelContainerRun;
7272
73+ //  Function pointer types needed by Metal backend
74+ using  AOTInductorModelContainerGetInputNameFunc = AOTIRuntimeError (*)(
75+     AOTInductorModelContainerHandle container_handle,
76+     size_t  input_idx,
77+     const  char ** input_name);
78+ 
79+ using  AOTInductorModelContainerGetNumConstantsFunc = AOTIRuntimeError (*)(
80+     AOTInductorModelContainerHandle container_handle,
81+     size_t * num_constants);
82+ 
83+ //  Global function pointers needed by Metal backend
84+ extern  AOTInductorModelContainerGetInputNameFunc
85+     AOTInductorModelContainerGetInputName;
86+ extern  AOTInductorModelContainerGetNumConstantsFunc
87+     AOTInductorModelContainerGetNumConstants;
88+ 
7389} //  extern "C"
7490
7591//  AOTI Delegate Handle structure
Original file line number Diff line number Diff line change @@ -145,6 +145,11 @@ void cleanup_tensor_metadata() {
145145  internal::tensor_to_strides.clear ();
146146}
147147
148+ //  Needed by Metal backend
149+ size_t  aoti_torch_dtype_element_size (int32_t  dtype) {
150+   return  dtype_to_element_size (dtype);
151+ }
152+ 
148153} //  extern "C"
149154
150155} //  namespace aoti
Original file line number Diff line number Diff line change @@ -68,6 +68,9 @@ void aoti_torch_grad_mode_set_enabled(bool enabled);
6868//  Cleanup functions for clearing global state
6969void  cleanup_tensor_metadata ();
7070
71+ //  Needed by Metal backend
72+ size_t  aoti_torch_dtype_element_size (int32_t  dtype);
73+ 
7174} //  extern "C"
7275
7376} //  namespace aoti
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments