File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -291,6 +291,24 @@ def load(self, soname):
291291 """
292292 return npct .load_library (str (self .get_jit_dir ().joinpath (soname )), '.' )
293293
294+ def save_header (self , filename , code ):
295+ """
296+ Store some source code into a header file within the same temporary directory
297+ used for JIT compilation.
298+
299+ Parameters
300+ ----------
301+ filename : str
302+ The name of the header file (w/o the suffix).
303+ code : str
304+ The source code to be stored.
305+ """
306+ dest = self .get_jit_dir ()
307+ hfile = dest .joinpath (filename )
308+ with open (str (hfile ), 'w' ) as f :
309+ f .write (code )
310+ debug (f"{ self } : `jit.h` successfully saved in `{ self .get_jit_dir ()} `" )
311+
294312 def save (self , soname , binary ):
295313 """
296314 Store a binary into a file within a temporary directory.
You can’t perform that action at this time.
0 commit comments