This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][1/3] Introduce the KernelEnvironment into the device runtimes
ClosedPublic

Authored by jdoerfert on Jan 9 2022, 7:15 PM.

Details

Summary

This introduces the kernel environment which contains information passed
by the compiler to a GPU kernel. For now it mostly encapsulated the
ident_t object and the execution configuration, thus information we
passed explicitly before. We will add more content, including mutable
content similar to the debug indention level, later on.

Diff Detail

Event Timeline

jdoerfert created this revision.Jan 9 2022, 7:15 PM
jdoerfert requested review of this revision.Jan 9 2022, 7:15 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 9 2022, 7:15 PM
jdoerfert added inline comments.Jan 21 2022, 2:23 PM
openmp/libomptarget/DeviceRTL/src/Debug.cpp
76
jhuber6 accepted this revision.Jan 21 2022, 3:51 PM

LGTM

This revision is now accepted and ready to land.Jan 21 2022, 3:51 PM
ye-luo added a subscriber: ye-luo.Jan 21 2022, 4:19 PM

It sounds like such info will be passed from host to the device once per kernel and the performance impact is negligible. Right?

It sounds like such info will be passed from host to the device once per kernel and the performance impact is negligible. Right?

The information is directly baked into the device image (in form of globals).
The transfer happens as you load the image, basically a few extra bytes per kernel but we had most of the things before as separate globals already anyway.
There is no kernel start cost to speak of, at least I don't expect any.

It sounds like such info will be passed from host to the device once per kernel and the performance impact is negligible. Right?

The information is directly baked into the device image (in form of globals).
The transfer happens as you load the image, basically a few extra bytes per kernel but we had most of the things before as separate globals already anyway.
There is no kernel start cost to speak of, at least I don't expect any.

Thanks for the clarification.

jdoerfert closed this revision.Jul 26 2023, 1:40 PM

Subsumed by D142569

Herald added a project: Restricted Project. · View Herald TranscriptJul 26 2023, 1:40 PM