This is an archive of the discontinued LLVM Phabricator instance.

Rebase D59319 on trunk
Needs ReviewPublic

Authored by JonChesterfield on Feb 27 2020, 11:35 AM.

Details

Reviewers
jdoerfert
Summary

Rebase D59319 on trunk

Creating a new diff for convenience instead of modifying D59319.

Changes from D59319:
Fix up includes and cmake to match trunk
Minor fixes to comments
Move the shared_buffer struct into target_region.cu
__kmpc_target_region_kernel_parallel change UseSPMDMode from
uint16_t to int16_t, as it's called with (int)-1 from clang patch.
Change memcpy to builtin_memcpy as <cstring> memcpy may be unavailable

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptFeb 27 2020, 11:35 AM
  • drop the small buffer optimization to simplify the initial implementation

I added two comments. Given that this is a device runtime interface we can easily change it as we go.

When I initially wrote this I didn't add unit tests. Can we do that?

openmp/libomptarget/deviceRTLs/common/src/target_region.cu
1

Is this still CUDA?

openmp/libomptarget/deviceRTLs/common/target_region.h
100

We might actually want a bitvector here. Or a struct. Either one for all functions or one for each.

JonChesterfield marked 2 inline comments as done.Mar 6 2020, 3:04 PM

Testing is a sore point. I haven't found an acceptably low boilerplate way to write them for this library yet - should probably take another look.

openmp/libomptarget/deviceRTLs/common/src/target_region.cu
1

Almost nothing in the runtime is cuda anymore. I need to patch the nvptx build to let the extensions be c++. But yeah, comment could change.

openmp/libomptarget/deviceRTLs/common/target_region.h
100

It's likely to be inlined, so bool/struct may optimise better than a bitvector. I'm expecting the interfaces to change as the compiler comes online anyway.

Testing is a sore point. I haven't found an acceptably low boilerplate way to write them for this library yet - should probably take another look.

Let's postpone this for now. TBH, we need to address this but we also need to make the OMPIRBuilder generate all the target code.

openmp/libomptarget/deviceRTLs/common/target_region.h
100

Agreed. We can also change it as we go.