[Openmp-commits] [PATCH] D68310: Introduce an interface for target_impl that supports default implementations
Johannes Doerfert via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Wed Oct 2 06:48:34 PDT 2019
jdoerfert added a comment.
In D68310#1691089 <https://reviews.llvm.org/D68310#1691089>, @JonChesterfield wrote:
> Above you said
>
> > we could deal with them with different headers, the same way as I proposed to work with different targets.
>
> Please could you expand on that? I think the current multitarget plan is a `common` folder containing as much code as we can manage, with a `target_impl.h` in each target, where `#include` paths are set by cmake to look in the target subdir when compiling things in the common subdir. I can see a path to default functions that involves a separate header per function, where the existence of files on disk and some cmake determines which set are pulled into an aggregate header. That's not necessarily what you have in mind though.
A header file per function, or set of function that belong together, was what I meant. I'm still unsure how much "target specific code" we want to provide as a default without it becoming completely target independent. If there is code to be shared now, I mean with hopefully soon two targets, we could just call it common code. Once we get to the situation with >2 targets and not all but some share some code, we can reevaluate and determine the best solution for the actual use case at hand. I'm not strictly against templates or overloading but these do not solve all problems but basically only the ones we do not face yet. Designing something for a future use case is generally to be avoided (IMO).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68310/new/
https://reviews.llvm.org/D68310
More information about the Openmp-commits
mailing list