diff --git a/backends/cuda/ceed-cuda-compile.cpp b/backends/cuda/ceed-cuda-compile.cpp index 7f7a4a9dde..4002671e31 100644 --- a/backends/cuda/ceed-cuda-compile.cpp +++ b/backends/cuda/ceed-cuda-compile.cpp @@ -38,7 +38,7 @@ int CeedCompile_Cuda(Ceed ceed, const char *source, CUmodule *module, const Ceed size_t ptx_size; char *ptx; const char *jit_defs_path, *jit_defs_source; - const int num_opts = 3; + const int num_opts = 4; CeedInt num_jit_source_dirs = 0; const char **opts; nvrtcProgram prog; @@ -95,6 +95,7 @@ int CeedCompile_Cuda(Ceed ceed, const char *source, CUmodule *module, const Ceed + std::to_string(prop.major) + std::to_string(prop.minor); opts[1] = arch_arg.c_str(); opts[2] = "-Dint32_t=int"; + opts[3] = "-DCEED_RUNNING_JIT_PASS=1"; { const char **jit_source_dirs; diff --git a/backends/hip/ceed-hip-compile.cpp b/backends/hip/ceed-hip-compile.cpp index 0fb517c6d6..320c0961e6 100644 --- a/backends/hip/ceed-hip-compile.cpp +++ b/backends/hip/ceed-hip-compile.cpp @@ -37,7 +37,7 @@ int CeedCompile_Hip(Ceed ceed, const char *source, hipModule_t *module, const Ce size_t ptx_size; char *jit_defs_source, *ptx; const char *jit_defs_path; - const int num_opts = 3; + const int num_opts = 4; CeedInt num_jit_source_dirs = 0; const char **opts; int runtime_version; @@ -92,6 +92,7 @@ int CeedCompile_Hip(Ceed ceed, const char *source, hipModule_t *module, const Ce std::string arch_arg = "--gpu-architecture=" + std::string(prop.gcnArchName); opts[1] = arch_arg.c_str(); opts[2] = "-munsafe-fp-atomics"; + opts[3] = "-DCEED_RUNNING_JIT_PASS=1"; { const char **jit_source_dirs; diff --git a/include/ceed.h b/include/ceed.h index effe28eaf1..b905b30851 100644 --- a/include/ceed.h +++ b/include/ceed.h @@ -1 +1,5 @@ +#ifdef CEED_RUNNING_JIT_PASS +#include "ceed/types.h" +#else #include "ceed/ceed.h" +#endif diff --git a/include/ceed/types.h b/include/ceed/types.h index 6817a73322..6c6d126548 100644 --- a/include/ceed/types.h +++ b/include/ceed/types.h @@ -10,8 +10,10 @@ #ifndef CEED_QFUNCTION_DEFS_H #define CEED_QFUNCTION_DEFS_H +#ifndef CEED_RUNNING_JIT_PASS #include #include +#endif /** @ingroup CeedQFunction diff --git a/tests/test-include/fake-sys-include.h b/tests/test-include/fake-sys-include.h index c6069d006a..ec1c9b2c56 100644 --- a/tests/test-include/fake-sys-include.h +++ b/tests/test-include/fake-sys-include.h @@ -2,9 +2,9 @@ // Note - files included this way cannot transitively include any files CUDA/ROCm won't compile // These are bad -// #include // #include // #include -// This is ok +// These are ok +#include #include