[Openmp-commits] [PATCH] D68615: [libomptarget][nfc] Make interface.h target independent

Jon Chesterfield via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Oct 7 19:05:25 PDT 2019


JonChesterfield added a comment.

I'm expecting most code moved under common to need `#include "target_impl.h"`, located as you describe. loop.cu etc fit that category, a couple of files may not need any target stuff at all.

The library API is a flat description of everything the user (well, mostly the compiler) can find within the compiled library. It's currently called interface.h (I'd prefer `libomptarget/deviceRTLs/deviceRTL.h`). Including options.h or target_impl.h in the interface (as we have now) pulls in a bunch of macros and symbols that happen to be nearby.

Equivalent to this change would be creating a file `nvptx/src/target_interface.h` (or maybe nvptx_interface.h) containing the #define and typedef, then changing interface.h to:

  #ifdef __CUDACC__
  #include "../nvptx/src/target_interface.h"
  #endif

Or `s$src$include$`, and optionally replace the relative include with more cmake.

I'd like to be able to #include "deviceRTL/interface.h" from test code and have no idea which instantiation it runs against, but it's not a disaster if the interface.h also needs a bunch of cmake wiring to located the rest of said interface.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68615/new/

https://reviews.llvm.org/D68615





More information about the Openmp-commits mailing list