This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][libomptarget] make omp_get_initial_device 5.1 compliant
ClosedPublic

Authored by protze.joachim on Sep 23 2020, 6:03 AM.

Details

Summary

OpenMP 5.1 defines omp_get_initial_device to return the same value as omp_get_num_devices.

Since this change is also 5.0 compliant, no versioning is needed.

Diff Detail

Event Timeline

protze.joachim created this revision.Sep 23 2020, 6:03 AM
protze.joachim requested review of this revision.Sep 23 2020, 6:03 AM

Removed accidently added printf from a test.

grokos added a subscriber: grokos.Sep 23 2020, 6:18 AM
grokos added inline comments.
openmp/runtime/src/kmp.h
3879

So we can also remove the HOST_DEVICE macro from openmp/libomptarget/include/omptarget.h:24.

Can you also remove the definition in the header file include/omptarget.h

#define HOST_DEVICE -10

Removed HOST_DEVICE definition from the header as suggested in the reviews.

jdoerfert accepted this revision.Sep 25 2020, 9:25 AM

LGTM, one nit. Give @grokos and @RaviNarayanaswamy some time to comment or accept as well.

openmp/runtime/src/kmp_ftn_entry.h
969–970

Nit: Please put the comments in the line before, also below.

This revision is now accepted and ready to land.Sep 25 2020, 9:25 AM
grokos accepted this revision.Sep 25 2020, 2:53 PM

LGTM as well.