[libomptarget] Implement get_device_num for amdgcn, nvptx
Adds a field to the existing environment struct which is used for debug_level.
Paths
| Differential D91713
[libomptarget] Implement get_device_num for amdgcn, nvptx AcceptedPublic Authored by JonChesterfield on Nov 18 2020, 8:07 AM.
Details
Summary [libomptarget] Implement get_device_num for amdgcn, nvptx Adds a field to the existing environment struct which is used for debug_level.
Diff Detail
Event Timeline
Comment Actions Overall LGTM.
This revision is now accepted and ready to land.Nov 18 2020, 11:16 AM Comment Actions Please also add test case(s) for this. However, it actually depends on the native runtime that which device should be 0, 1, etc., which is probably hard to determine in OpenMP. Comment Actions Open to suggestions on testing. Calling it from a target region on amdgcn with multiple GPUs works. I don't have a cuda machine with multiple cards. A machine with one target returns 0 with or without this patch. Do we have any runtime tests for openmp in tree? Would need a CI machine with GPUs Comment Actions
I wrote a simple program to test this patch and it works as expected. Please add the test case into this patch. Herald added projects: Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project. · View Herald Transcript Herald added subscribers: llvm-commits, libc-commits, libcxx-commits and 100 others. · View Herald Transcript This revision now requires review to proceed.Nov 23 2020, 4:34 PM JonChesterfield removed reviewers: whitequark, bollu, JDevlieghere, • espindola, andreadb, alexander-shaposhnikov, lebedev.ri, rupprecht, jhenderson, shafik, mravishankar, antiagainst, nicolasvasilache, herhut, rriddle, aartbik, MaskRay, sscalpone, jpienaar, ftynse, aaron.ballman, silvas, Restricted Project, Restricted Project.Nov 23 2020, 4:35 PM JonChesterfield removed projects: Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project. This revision is now accepted and ready to land.Nov 23 2020, 4:36 PM Herald added projects: Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project. · View Herald Transcript This revision now requires review to proceed.Nov 23 2020, 4:36 PM JonChesterfield removed reviewers: bollu, • espindola, andreadb, alexander-shaposhnikov, lebedev.ri, rupprecht, jhenderson, shafik, mravishankar, antiagainst, nicolasvasilache, herhut, rriddle, MaskRay, sscalpone, jpienaar, ftynse, aaron.ballman, silvas, aartbik, Restricted Project, Restricted Project.Nov 23 2020, 4:38 PM JonChesterfield removed projects: Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project, Restricted Project. This revision is now accepted and ready to land.Nov 23 2020, 4:38 PM Comment Actions Apologies to the hundreds of reviewers who have just been spammed. Today I learned that 'arc diff --update' is not relative to the patch one is updating, but is relative to master as exists on github. Also that phabricator will not let one delete some automatically added reviewers before fixing the diff. Comment Actions This needs an implementation for x86_64 offloading or a change to the test to only run on nvptx. Intend to do the former.
Revision Contents
Diff 307216 openmp/libomptarget/deviceRTLs/amdgcn/CMakeLists.txt
openmp/libomptarget/deviceRTLs/common/debug.h
openmp/libomptarget/deviceRTLs/common/device_environment.h
openmp/libomptarget/deviceRTLs/common/omptarget.h
openmp/libomptarget/deviceRTLs/common/src/libcall.cu
openmp/libomptarget/deviceRTLs/common/src/omp_data.cu
openmp/libomptarget/deviceRTLs/interface.h
openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
openmp/libomptarget/include/device_environment.h
openmp/libomptarget/plugins/CMakeLists.txt
openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
openmp/libomptarget/plugins/cuda/src/rtl.cpp
openmp/libomptarget/test/offloading/get_device_num.c
|
clang-tidy: error: 'device_environment.h' file not found [clang-diagnostic-error]
not useful