We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 570605c commit daecec4Copy full SHA for daecec4
1 file changed
devito/arch/compiler.py
@@ -291,6 +291,22 @@ def load(self, soname):
291
"""
292
return npct.load_library(str(self.get_jit_dir().joinpath(soname)), '.')
293
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
+ hfile = self.get_jit_dir().joinpath(filename).with_suffix('.h')
307
+ with open(str(hfile), 'w') as f:
308
+ f.write(code)
309
310
def save(self, soname, binary):
311
312
Store a binary into a file within a temporary directory.
0 commit comments