Skip to content

Commit 29cd299

Browse files
committed
Fix liboffload build with OMPT_SUPPORT enabled
1 parent 901946c commit 29cd299

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

offload/liboffload/src/OffloadImpl.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,21 @@ PlatformVecT &Platforms() {
4040
return Platforms;
4141
}
4242

43+
// TODO: Some plugins expect to be linked into libomptarget which defines these
44+
// symbols to implement ompt callbacks. The least invasive workaround here is to
45+
// define them in libLLVMOffload as false/null so they are never used. In future
46+
// it would be better to allow the plugins to implement callbacks without
47+
// pulling in details from libomptarget.
48+
#ifdef OMPT_SUPPORT
49+
namespace llvm::omp::target {
50+
namespace ompt {
51+
bool Initialized = false;
52+
ompt_get_callback_t lookupCallbackByCode = nullptr;
53+
ompt_function_lookup_t lookupCallbackByName = nullptr;
54+
} // namespace ompt
55+
} // namespace llvm::omp::target
56+
#endif
57+
4358
// Every plugin exports this method to create an instance of the plugin type.
4459
#define PLUGIN_TARGET(Name) extern "C" GenericPluginTy *createPlugin_##Name();
4560
#include "Shared/Targets.def"

0 commit comments

Comments
 (0)