File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 11#include  "onnxruntime_c_api.h" 
2- #include  "cpu_provider_factory.h" 
32#if  !defined(__APPLE__ )
3+ #include  "cpu_provider_factory.h" 
44#include  "cuda_provider_factory.h" 
55#endif 
Original file line number Diff line number Diff line change @@ -131,15 +131,16 @@ impl<'a> SessionBuilder<'a> {
131131    } 
132132
133133    /// Set the session to use cpu 
134+      #[ cfg( feature = "cuda" ) ]  
134135    pub  fn  use_cpu ( self ,  use_arena :  i32 )  -> Result < SessionBuilder < ' a > >  { 
135136        unsafe  { 
136137            sys:: OrtSessionOptionsAppendExecutionProvider_CPU ( self . session_options_ptr ,  use_arena) ; 
137138        } 
138139        Ok ( self ) 
139140    } 
140141
141-     #[ cfg( feature = "cuda" ) ]  
142142    /// Set the session to use cuda 
143+      #[ cfg( feature = "cuda" ) ]  
143144    pub  fn  use_cuda ( self ,  device_id :  i32 )  -> Result < SessionBuilder < ' a > >  { 
144145        unsafe  { 
145146            sys:: OrtSessionOptionsAppendExecutionProvider_CUDA ( self . session_options_ptr ,  device_id) ; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments