Use the loaded headers from the previous file#130
Use the loaded headers from the previous file#130thomasfrosio wants to merge 2 commits intoNVIDIA:jitify2from
Conversation
|
After looking at it more closely, this may be dangerous with the This happens here: Lines 5973 to 5983 in 2a7d754 These two lines seem problematic, or at least I don't understand it: Lines 5977 to 5978 in 2a7d754 Is that supposed to detect However, when loading new headers, everything seem okay and Lines 6119 to 6123 in 2a7d754 Not sure if I'm misusing the library or if it's a bug. |
|
I like this idea, but I think you're right that we need to be careful to avoid patching cuda/std headers or double-patching other headers. I think the logic here is correct (because the workaround system headers are added via Maybe you could make this op-in via a command line flag like Note that #131 will dramatically speed up preprocessing (orthogonal to this PR) once it lands. I will think about how we can enhance the new preprocessing logic to detect headers that we don't want to (re-)patch. |
Instead of preprocessing every source file from scratch, why not use the already loaded headers?
Please correct me if I'm wrong.
Currently,
jitifyloads and preprocesses the source files in a distributed approach, i.e. each file is preprocessed independently from the others, and the loaded headers are then added to theall_header_sourcesmap.std::unordered_map::insert()will automatically filter redundant entries on a first-in first-out basis.This is all fine, but since the files are preprocessed one after the other, why not instead add the already known headers from the previous files to the list of headers that
nvrtccan use for the next file? As I'm sure you've noticed, lettingjitifycollecting the headers fromnvrtc's error messages quickly adds up when there's a lot of headers. For files that include a lot of the same headers (which I assume is a very common scenario), this simple change makes a big difference performance-wise and should produce exactly the same output, right? I use--shared-headersoption and it seems to work fine.HTH,
Thomas