summaryrefslogtreecommitdiffstats
path: root/openmp/libomptarget/src/interface.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [OpenMP 5.0] libomptarget interface for declare mapper functions.Michael Kruse2019-08-041-0/+22
| | | | | | | | | | | | | | | | | | This patch implements the libomptarget runtime interface for OpenMP 5.0 declare mapper functions. The declare mapper functions generated by Clang will call them to complete the mapping of members. kmpc_mapper_num_components gets the current number of components for a user-defined mapper; kmpc_push_mapper_component pushes back one component for a user-defined mapper. The design slides can be found at https://github.com/lingda-li/public-sharing/blob/master/mapper_runtime_design.pptx Patch by Lingda Li <lildmh@gmail.com> Differential Revision: https://reviews.llvm.org/D60972 llvm-svn: 367772
* [libomptarget] Handle offload policy in push_tripcountJonas Hahnfeld2019-07-231-0/+3
| | | | | | | | | | | | | | | If the first target region in a program calls the push_tripcount function, libomptarget didn't handle the offload policy correctly. This could lead to unexpected error messages as seen in http://lists.llvm.org/pipermail/openmp-dev/2019-June/002561.html To solve this, add a check calling IsOffloadDisabled() as all other entry points already do. If this method returns false, libomptarget is effectively disabled. Differential Revision: https://reviews.llvm.org/D64626 llvm-svn: 366810
* [OPENMP]Fix threadid in __kmpc_omp_taskwait call for dependent target calls.Alexey Bataev2019-07-161-5/+5
| | | | | | | | | | | | | | | | | Summary: We used to call __kmpc_omp_taskwait function with global threadid set to 0. It may crash the application at the runtime if the thread executing target region is not a master thread. Reviewers: grokos, kkwli0 Subscribers: guansong, jdoerfert, caomhin, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D64571 llvm-svn: 366220
* [libomptarget] Fix typos and grammar in error messages, NFC.Jonas Hahnfeld2019-07-121-4/+4
| | | | llvm-svn: 365890
* [OPENMP]Rename loopTripCnt member data to LoopTripCnt, NFC.Alexey Bataev2019-07-081-1/+1
| | | | | | Rename variable to follow LLVM coding standard. llvm-svn: 365368
* [OPENMP]Make __kmpc_push_tripcount thread safe.Alexey Bataev2019-07-081-3/+4
| | | | | | | | | | | | | | | | | | | | | | Summary: __kmpc_push_tripcount function is not thread safe and may lead to data race when the target regions are executed in parallel threads. The patch makes loopTripCnt counter thread aware and stores the tripcount value per thread in the map. Access to map is guarded by mutex to prevent data race in the map itself. Test is for NVPTX target because it does not work correctly on the host. Seems to me, there is a problem in libomp with target regions in the parallel threads. Reviewers: grokos Subscribers: guansong, jfb, jdoerfert, openmp-commits, kkwli0, caomhin Tags: #openmp Differential Revision: https://reviews.llvm.org/D64080 llvm-svn: 365332
* [OpenMP][libomptarget] Enable requires flags for target libraries.Gheorghe-Teodor Bercea2019-05-211-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Target link variables are currently implemented by creating a copy of the variables on the device side and unified memory never gets exploited. When the prgram uses the: ``` #pragma omp requires unified_shared_memory ``` directive in conjunction with a declare target link, the linked variable is no longer allocated on the device and the host version is used instead. This behavior is overridden by performing an explicit mapping. A Clang side patch is required. Reviewers: ABataev, AlexEichenberger, grokos, Hahnfeld Reviewed By: AlexEichenberger, grokos, Hahnfeld Subscribers: Hahnfeld, jfb, guansong, jdoerfert, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D60223 llvm-svn: 361294
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | | to reflect the new license. These used slightly different spellings that defeated my regular expressions. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351648
* [libomptarget] Remove two unneeded includes, NFCI.Jonas Hahnfeld2018-09-061-1/+0
| | | | | | Follow-up to r340542 and r340767. llvm-svn: 341563
* [OpenMP][libomptarget] rework of fatal error reportingAlexandre Eichenberger2018-08-271-4/+4
| | | | | | | | | | | | | | | | Summary: Removed the function that used a lock and varargs Used the same mechanism as for debug messages Reviewers: ABataev, gtbercea, grokos, Hahnfeld Reviewed By: gtbercea, Hahnfeld Subscribers: mikerice, ABataev, RaviNarayanaswamy, guansong, openmp-commits Differential Revision: https://reviews.llvm.org/D51226 llvm-svn: 340767
* [OpenMP][libomptarget] Bringing up to spec with respect to ↵Alexandre Eichenberger2018-08-231-4/+73
| | | | | | | | | | | | | | | | | | OMP_TARGET_OFFLOAD env var Summary: Right now, only the OMP_TARGET_OFFLOAD=DISABLED was implemented. Added support for the other MANDATORY and DEFAULT values. Reviewers: gtbercea, ABataev, grokos, caomhin, Hahnfeld Reviewed By: Hahnfeld Subscribers: protze.joachim, gtbercea, AlexEichenberger, RaviNarayanaswamy, Hahnfeld, guansong, openmp-commits Differential Revision: https://reviews.llvm.org/D50522 llvm-svn: 340542
* [OpenMP][libomptarget] New map interface: remove translation code and ensure ↵George Rokos2018-07-191-303/+52
| | | | | | | | | | | | | | | proper alignment of struct members This patch removes the translation code since this functionality is now implemented in the compiler. target_data_begin and target_data_end are also patched to handle some special cases that used to be handled by the obsolete translation function, namely ensure proper alignment of struct members when we have partially mapped structs. Mapping a struct from a higher address (i.e. not from its beginning) can result in distortion of the alignment for some of its member fields. Padding restores the original (proper) alignment. Differential revision: https://reviews.llvm.org/D44186 llvm-svn: 337455
* Sprinkle a few <cstdlib> includes, for libomptarget sources usingDimitry Andric2018-01-181-0/+1
| | | | | | malloc, free, alloca and getenv. NFCI. llvm-svn: 322869
* [libomptarget] Split implementation of interface functionsJonas Hahnfeld2017-12-061-0/+501
This last of four patches adds a new file for the interface functions that Clang uses during code generation. The only change except simply moving the current code is renaming the function CheckDeviceAndCtors() and using the correct type for 64bit device ids. Differential Revision: https://reviews.llvm.org/D40801 llvm-svn: 319972
OpenPOWER on IntegriCloud