This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][PoC][WIP] Device Rewrite, ICVs, ThreadState
Needs ReviewPublic

Authored by jdoerfert on Mar 10 2021, 7:10 AM.

Details

Reviewers
bollu
Summary

Make ICVs work across the board

Diff Detail

Event Timeline

jdoerfert created this revision.Mar 10 2021, 7:10 AM
jdoerfert requested review of this revision.Mar 10 2021, 7:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 10 2021, 7:10 AM
Herald added a subscriber: sstefan1. · View Herald Transcript
jdoerfert added inline comments.Mar 10 2021, 8:15 AM
openmp/libomptarget/deviceRTLs/common/include/ThreadState.h
53

I think we want a per warp array as we can reasonably synchronize then. The first draft did not have a preallocated array at all but it is hard to create it properly at runtime if you have no idea what threads are running.

openmp/libomptarget/deviceRTLs/common/src/ICVs.cpp
100

This is a scheme that needs to be generalized for other "setters".

openmp/libomptarget/deviceRTLs/common/src/parallel.cu
260

conceptually this should be the other way around, omp_get_thread_num calls this function. However, we should make the names actually match, so the impl. of omp_XXX is in __kmpc_XXX.

tianshilei1992 added inline comments.
openmp/libomptarget/deviceRTLs/common/include/ThreadState.h
53

If we can get rid of static allocation here (basically the array) and use a dynamic one, it can help us a lot in terms of separating common part and target dependent part.

@tianshilei1992 would you mind taking over the patch?

openmp/libomptarget/deviceRTLs/common/include/ThreadState.h
53

I would prefer a dynamic one yes. potentially even one per warp. The elements would be WarpStateTy which is WARP_SIZE*ThreadStateTy.