[Openmp-commits] [PATCH] D68310: Introduce an interface for target_impl that supports default implementations

Jon Chesterfield via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Oct 1 17:37:57 PDT 2019


JonChesterfield created this revision.
JonChesterfield added reviewers: jdoerfert, ABataev, grokos, ronlieb, gregrodgers.
Herald added a project: OpenMP.
Herald added a subscriber: openmp-commits.

Introduce an interface for target_impl that supports default implementations

Design goals:

- No runtime indirection
- Permit header-only implementations for inlining under nvcc
- Permit default implementations
- Catch various errors at compile time
- Syntactically reasonable
- Familiar to C++ developers

The API is an adaption of the curiously recuring template pattern, modified to
use static calls throughout. This gives the impl::Bits::pack syntax that matches
free functions in a namespace, which is essentially what the static functions in
a non-template class are.

Marking methods as `= delete` provides better diagnostics than missing symbols
at link time. The friend/private annotations are  analogous to the non-virtual
interface of runtime dispatch.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D68310

Files:
  openmp/libomptarget/deviceRTLs/nvptx/src/loop.cu
  openmp/libomptarget/deviceRTLs/nvptx/src/reduction.cu
  openmp/libomptarget/deviceRTLs/nvptx/src/target_api.h
  openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68310.222735.patch
Type: text/x-patch
Size: 4652 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20191002/26ab1dd1/attachment.bin>


More information about the Openmp-commits mailing list