LLNL / GridKit

Experimental code for prototyping interfaces betwen numerical libraries and network models.
Other
5 stars 1 forks source link

Add preliminary Enzyme support #6

Open ashermancinelli opened 2 years ago

ashermancinelli commented 2 years ago

Manually running the Enzyme optimization pass requires a 5-pass compilation pipeline. The Enzyme plugin ClangEnzyme-15.so seems to be a clang plugin, which would lead me to believe we can run it directly through clang instead of the manual process I use below, but I couldn't get it to work and I find no examples that work for me.

The two drivers I added could be tests, but I can't seem to get $<TARGET_FILE:foo> to work with my custom pipeline. Maybe @CameronRutherford has an idea?

cameronrutherford commented 2 years ago

Perhaps you have to create a new executable with add_executable, link in the enzyme generated library, and then add that new executable to the test in order to have that work. I don't think targetting the output from add_custom_target with $<TARGET_FILE:> quite works https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html#target-dependent-queries...

pelesh commented 1 year ago

CC @michel2323