Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Experimental/corbett/jit #1333

Closed
wants to merge 10 commits into from
40 changes: 40 additions & 0 deletions src/coreComponents/finiteElement/kernelInterface/kernelJIT.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#include "KernelBase.hpp"
#include "kernelJITCompileCommands.hpp" // generated by cmake / jit python script / contains needed macros

namespace geosx
{
namespace finiteElement
{

#if defined( GEOSX_USE_CUDA )
constexpr bool compilerIsNVCC = true;
#else
constexpr bool compilerIsNVCC = false;
#endif

jitti::CompilationInfo getKernelCompilationInfo( const string & header )
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So my idea is that for each kernel header we'd have a source that includes the header and has the method to get thejitti::CompilationInfo(s) for the kernel(s) in the header. That way if the kernel (header) changes and the user rebuilds GEOSX then the compile time in the compilation info gets updated and so things will be re-jitted.

I think with this implementation it won't rejit if say the solid mechanics kernels are modified and GEOSX is rebuilt, only if some dependency of KernelBase.hpp is modified.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that is probably true in the current implementation.

This is the first thing I'll take a look at changing from the current implementation, and then I'll look at adding in the compile-time pre-jit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.

{
jitti::CompilationInfo info;
info.compileCommand = kernelJIT_COMPILE_COMMAND;
info.compilerIsNVCC = compilerIsNVCC;
info.linker = kernelJIT_LINKER;
info.linkArgs = kernelJIT_LINK_ARGS;
info.headerFile = header;
info.templateFunction = "geosx::finiteElement::buildKernelAndInvoke";
return info;
}

jitti::CompilationInfo getSparsityCompilationInfo( const string & header )
{
jitti::CompilationInfo info;
info.compileCommand = kernelJIT_COMPILE_COMMAND;
info.compilerIsNVCC = compilerIsNVCC;
info.linker = kernelJIT_LINKER;
info.linkArgs = kernelJIT_LINK_ARGS;
info.headerFile = header;
info.templateFunction = "geosx::finiteElement::buildSparsityAndInvoke";
return info;
}
}
}