summaryrefslogtreecommitdiffstats
path: root/openmp
Commit message (Collapse)AuthorAgeFilesLines
...
* [OMPT] Resolve warnings because of ints in if conditionsJonas Hahnfeld2019-08-153-15/+10
| | | | | | | | | | | | | The implementation status can only be one of ompt_event_UNIMPLEMENTED = ompt_set_never = 1 ompt_event_MAY_ALWAYS = ompt_set_always = 5 In both cases, the condition was already true, so just remove the check. Differential Revision: https://reviews.llvm.org/D65869 llvm-svn: 369001
* [OpenMP] Turn on -Wall compiler warnings by defaultJonas Hahnfeld2019-08-154-55/+59
| | | | | | | | | | | | | | | | | | Instead, maintain a list of disabled options to still build libomp and libomptarget without warnings. This includes -Wno-error and -Wno-pedantic to silence warnings that LLVM enables when building in-tree. I tested the following compilers: * Clang 6.0, 7.0, 8.0 * GCC 4.8.5 (CentOS 7), GCC 6, 7, 8, 9 * Intel Compiler 16, 17, 18, 19 RFC thread on openmp-dev mailing list: http://lists.llvm.org/pipermail/openmp-dev/2019-August/002668.html Differential Revision: https://reviews.llvm.org/D65867 llvm-svn: 368999
* Factor architecture dependent code out of loop.cuJon Chesterfield2019-08-132-9/+49
| | | | | | | | | | | | | | | | | | | | | Summary: [libomptarget] Factor architecture dependent code out of loop.cu Related to the patch series starting D64217. Added subscribers to said series as reviewers. This effort is smaller in scope. This patch factors out just enough architecture dependent code from loop.cu to allow the same source to be used with amdgcn, given a different target_impl.h. Testing is that the same bitcode (modulo variable names) is generated for libomptarget before and after the refactor, for nvptx and the out of tree amdgcn. Reviewers: jdoerfert, ABataev, bollu, jfb, tra, grokos, Hahnfeld, guansong, xtian, gregrodgers, ronlieb, hfinkel, gtbercea, guraypp, arpith-jacob Reviewed By: jdoerfert, ABataev Subscribers: dexonsmith, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D65836 llvm-svn: 368751
* Cleanup unused variable.Andrey Churbanov2019-08-121-3/+1
| | | | | | | | | | | This patch fixes problem raised in post-review comments of the https://reviews.llvm.org/D65285. Developers of ittnotify confirmed that dll_path_ptr field of the __itt_global structure is never used by ittnotify library, so it is safe to remove the dll_path array. Differential Revision: https://reviews.llvm.org/D65885 llvm-svn: 368559
* [OpenMP][libomptarget] Add support for close map modifierGheorghe-Teodor Bercea2019-08-097-15/+344
| | | | | | | | | | | | | | | | | | | Summary: This patch adds support for the close map modifier. The close map modifier will overwrite the unified shared memory requirement and create a device copy of the data. Reviewers: ABataev, Hahnfeld, caomhin, grokos, jdoerfert, AlexEichenberger Reviewed By: Hahnfeld, AlexEichenberger Subscribers: guansong, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D65340 llvm-svn: 368488
* [libomptarget] Remove duplicate RTLRequiresFlags per deviceJonas Hahnfeld2019-08-095-21/+14
| | | | | | | | | | | | | | | We have one global RTLs.RequiresFlags, I don't see a need to make a copy per device that the runtime manages. This was problematic anyway because the copy happened during the first __tgt_register_lib(). This made it impossible to call __tgt_register_requires() from normal user funtions for testing. Hence, this change also fixes unified_shared_memory/shared_update.c for older versions of Clang that don't call __tgt_register_requires() before __tgt_register_lib(). Differential Revision: https://reviews.llvm.org/D66019 llvm-svn: 368465
* [OpenMP][libomptarget] Add support for unified memory for regular mapsGheorghe-Teodor Bercea2019-08-077-47/+383
| | | | | | | | | | | | | | | | | | | Summary: This patch adds support for using unified memory in the case of regular maps that happen when a target region is offloaded to the device. For cases where only a single version of the data is required then the host address can be used. When variables need to be privatized in any way or globalized, then the copy to the device is still required for correctness. Reviewers: ABataev, jdoerfert, Hahnfeld, AlexEichenberger, caomhin, grokos Reviewed By: Hahnfeld Subscribers: mgorny, guansong, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D65001 llvm-svn: 368192
* Use forceinline. Necessary for nvcc to inline small functions within the ↵Jon Chesterfield2019-08-071-1/+1
| | | | | | | | | | | | | | | | | | bitcode library Summary: [libomptarget] Use forceinline. Necessary for nvcc to inline small functions within the bitcode library Suggested in D65836 Reviewers: ABataev, jdoerfert, grokos, gregrodgers Subscribers: openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D65876 llvm-svn: 368177
* [OPENMP][OFFLOADING]Fix the test, NFC.Alexey Bataev2019-08-061-4/+5
| | | | llvm-svn: 368068
* [OpenMP] Add support for GOMP_*_nonmonotonic_* functionsJonathan Peyton2019-08-052-0/+62
| | | | | | | | Patch by Isuru Fernando Differential Revision: https://reviews.llvm.org/D65714 llvm-svn: 367949
* [OpenMP] Fix broken build due to new OMPT testsHansang Bae2019-08-054-4/+4
| | | | | | | | | New OMPT tests with teams construct should be disabled for GCC as it emits code with a GOMP entry not supported in the LLVM runtime. Differential Revision: https://reviews.llvm.org/D65757 llvm-svn: 367939
* [libomptarget] Harmonize emitting CUDA errors and general debug messages.Michael Kruse2019-08-052-17/+11
| | | | | | | | | | | | | | | | | Ensures that CUDA fail reasons (such as "No CUDA-capable device detected") are printed together with libomptarget's debug message (e.g. "Error when setting CUDA context"). Previously, the former was printed only in CMAKE_BUILD_TYPE=Debug builds while the latter was enabled by LIBOMPTARGET_ENABLE_DEBUG. With this change, also only call cuGetErrorString when the error will be printed. Suggested-by: Ye Luo <xw111luoye@gmail.com> Differential Revision: https://reviews.llvm.org/D65687 llvm-svn: 367910
* [OpenMP 5.0] libomptarget interface for declare mapper functions.Michael Kruse2019-08-044-0/+88
| | | | | | | | | | | | | | | | | | 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
* Add OMPT support for teams constructHansang Bae2019-08-0312-63/+437
| | | | | | | | This change adds OMPT support for events from teams construct. Differential Revision: https://reviews.llvm.org/D64025 llvm-svn: 367746
* [OpenMP] Rename last file to cpp and remove LIBOMP_CFLAGSJonas Hahnfeld2019-07-306-33/+11
| | | | | | | | | | | | | All other files are already C++ and the build system has always passed '-x c++' for C files, effectively compiling them as C++. To stay warning free we need one fix in ittnotify_static.{c,cpp}: The variable dll_path can be written to, so it must not be const. GCC complained with -Wcast-qual and I think it's right. Differential Revision: https://reviews.llvm.org/D65285 llvm-svn: 367343
* [openmp] Workaround bug in old Android pthread_attr_setstacksizeYi Kong2019-07-251-0/+7
| | | | | | | | | | | | Round the stack size to a multiple of the page size. Older versions of Android (until KitKat) would fail pthread_attr_setstacksize with EINVAL if the stack size was not a multiple of the page size. Patch by Dan Albert <danalbert@google.com>. Test: Build, copied into the NDK, passed openmp test on ICS. Bug: https://github.com/android-ndk/ndk/issues/9 llvm-svn: 367070
* [OpenMP] Fix build of stubs library, NFC.Jonas Hahnfeld2019-07-251-2/+2
| | | | | | | | | | Both Clang and GCC complained that they cannot initialize a return object of type 'kmp_proc_bind_t' with an 'int'. While at it, also fix a warning about missing parentheses thrown by Clang. Differential Revision: https://reviews.llvm.org/D65284 llvm-svn: 367041
* [OPENMP][NVPTX]Perform memory flush if number of threads to sync is 1 or less.Alexey Bataev2019-07-252-0/+40
| | | | | | | | | | | | | | | | | Summary: According to the OpenMP standard, barrier operation must perform implicit flush operation. Currently, if there is only one thread in the team, barrier does not flush the memory. Patch fixes this problem. Reviewers: grokos, gtbercea, kkwli0 Subscribers: guansong, jdoerfert, openmp-commits, caomhin Tags: #openmp Differential Revision: https://reviews.llvm.org/D62398 llvm-svn: 367024
* [OpenMP] RISCV64 portJonas Hahnfeld2019-07-2519-16/+243
| | | | | | | | | | | | | | This is a port of libomp for the RISC-V 64-bit Linux target. We have tested this port on a HiFive Unleashed development board using a downstream LLVM that has support for the missing bits in upstream. As of now, all tests are passing, including OMPT. Patch by Ferran Pallarès! Differential Revision: https://reviews.llvm.org/D59880 llvm-svn: 367021
* [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
* [OMPT] Cleanup reset of exit_frame pointerJonas Hahnfeld2019-07-224-50/+88
| | | | | | | | | | | | | | | | | | This is done at call-site and does not need to be handled in __kmp_invoke_microtask. It was already absent from the x86 and x86_64 assembly, this patch removes it from the generic implementation in z_Linux_util.cpp and adds documentation for AArch64 and PPC64 that it's actually not needed. I can't test on these architectures, so I don't want to change the code just because it looks right :) While at it, rename some variables for consistency and add a check in test/ompt/parallel/normal.c that the pointer was reset before entering the barrier. Differential Revision: https://reviews.llvm.org/D64442 llvm-svn: 366721
* Delete empty fileJonas Hahnfeld2019-07-221-0/+0
| | | | | | This is a left-over from r356288 which was reviewed in D58989. llvm-svn: 366716
* [OpenMP][libomptarget] Suppress C++ 11 related warnings when building ↵Alexey Bataev2019-07-181-1/+1
| | | | | | | | | | | | | | | | | | libomptarget-nvptx bitcode library, by Doru Bercea. Summary: Pass -std=c++11 flag to compiler to suppress C++ 11 related warnings when building NVPTX bitcode library. Reviewers: ABataev, caomhin, Hahnfeld Reviewed By: ABataev, Hahnfeld Subscribers: jdoerfert, Hahnfeld, jholewinski, mgorny, guansong, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D55772 llvm-svn: 366438
* [OPENMP] Resolve lost LoopTripCnt for subsequent loops in same thread.Ron Lieberman2019-07-172-2/+41
| | | | | | | | | | Remove loopTripCnt from threaded device stack after consuming it. Added a libomptarget DP message to aid in future debugging and to validate the added testcase, which only runs in Debug build. Differential Revision: https://reviews.llvm.org/D64808 llvm-svn: 366349
* Remove REQUIRES OMP spec version within lit testsJonathan Peyton2019-07-1713-13/+0
| | | | | | | | This is a follow up patch to D64534 (r365963) which removed all OMP spec versioning within the OpenMP runtime codebase. This patch removes REQUIRES: openmp-x.y lines from lit tests. llvm-svn: 366341
* [OpenMP] Move header inclusion out of 'extern "C"'Jonas Hahnfeld2019-07-161-2/+3
| | | | | | | | | | This leads to problems when compiling C++ code with libc++ for Nvidia GPUs because Clang now uses wrappers for math functions that might include C++ templates not allowed in 'extern "C"'. Differentiel Revision: https://reviews.llvm.org/D64625 llvm-svn: 366229
* [OPENMP][NVPTX]Fixed checks for cuda versions.Alexey Bataev2019-07-161-2/+4
| | | | | | | | | | | | | | | | | | | | | Summary: We used CUDART_VERSION macro to check for the installed cuda version but this macro is defined in cuda_runtime_api.h, which is not used by project. Better to use CUDA_VERSION macro, which is defined in cuda.h. Also, added the check if this macro is defined. If macro is undefined, there is something wrong with the cuda configuration and we should not continue the compilation. This also fixes problems with runtime building in cuda 10+. Reviewers: grokos Subscribers: guansong, jdoerfert, caomhin, kkwli0, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D64648 llvm-svn: 366224
* [OPENMP]Fix threadid in __kmpc_omp_taskwait call for dependent target calls.Alexey Bataev2019-07-162-5/+67
| | | | | | | | | | | | | | | | | 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
* [OpenMP] Remove OMP spec versioningJonathan Peyton2019-07-1263-7281/+170
| | | | | | | | | | Remove all older OMP spec versioning from the runtime and build system. Patch by Terry Wilmarth Differential Revision: https://reviews.llvm.org/D64534 llvm-svn: 365963
* [libomptarget] Fix typos and grammar in error messages, NFC.Jonas Hahnfeld2019-07-121-4/+4
| | | | llvm-svn: 365890
* [libomptarget-nvptx] Remove dead functionsJonas Hahnfeld2019-07-112-85/+1
| | | | | | | | | These entry points are never called by Clang trunk nor clang-ykt. If XL doesn't use them either, they can finally go away. Differential Revision: https://reviews.llvm.org/D52700 llvm-svn: 365817
* NFC: fixed typo #ifdef --> #if to allow macro set to 0 work correctlyAndrey Churbanov2019-07-101-1/+1
| | | | llvm-svn: 365642
* [OPENMP]Rename loopTripCnt member data to LoopTripCnt, NFC.Alexey Bataev2019-07-083-6/+6
| | | | | | Rename variable to follow LLVM coding standard. llvm-svn: 365368
* [OPENMP]Make __kmpc_push_tripcount thread safe.Alexey Bataev2019-07-085-7/+37
| | | | | | | | | | | | | | | | | | | | | | 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
* Create a runtime option to disable task throttling.Andrey Churbanov2019-07-025-2/+82
| | | | | | | | Patch by viroulep (Philippe Virouleau) Differential Revision: https://reviews.llvm.org/D63196 llvm-svn: 364934
* Cleanup of unused codeAndrey Churbanov2019-07-026-25/+1
| | | | | | | | Patch by Terry Wilmarth Differential Revision: https://reviews.llvm.org/D63891 llvm-svn: 364925
* [OPENMP][NVPTX]Relax flush directive.Alexey Bataev2019-06-272-1/+36
| | | | | | | | | | | | | | | | | | | | | | | Summary: According to the OpenMP standard, flush makes a thread’s temporary view of memory consistent with memory and enforces an order on the memory operations of the variables explicitly specified or implied. According to the Cuda toolkit documentation (https://docs.nvidia.com/cuda/archive/8.0/cuda-c-programming-guide/index.html#memory-fence-functions), __threadfence() functions provides required functionality. __threadfence_system() also provides required functionality, but it also includes some extra functionality, like synchronization of page-locked host memory, synchronization for the host, etc. It is not required per the standard and we can use more relaxed version of memory fence operation. Reviewers: grokos, gtbercea, kkwli0 Subscribers: guansong, jfb, jdoerfert, openmp-commits, caomhin Tags: #openmp Differential Revision: https://reviews.llvm.org/D62397 llvm-svn: 364572
* Fixed memory use-after-free problem.Andrey Churbanov2019-06-262-3/+24
| | | | | | | | | | | Bug reported in https://bugs.llvm.org/show_bug.cgi?id=42269. Freeing of the contention group (CG) stucture by master thread looks wrong, because workers can leave the CG later on. Intead the freeing is now done by the last thread leaving the CG. Differential Revision: https://reviews.llvm.org/D63599 llvm-svn: 364456
* [OpenMP][libomptarget] Add support for declare target to clause under ↵Gheorghe-Teodor Bercea2019-06-191-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unified memory Summary: This patch adds support for handling variables under the: ``` #pragma omp declare target to() ``` clause when the ``` #pragma omp requires unified_shared_memory ``` is used. The address of the host variable is copied into the device pointer just like for the declare target link case. Reviewers: ABataev, caomhin, grokos, AlexEichenberger Reviewed By: grokos Subscribers: jcownie, guansong, jdoerfert, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D63106 llvm-svn: 363825
* [OPENMP][CUDA]Use __syncthreads when compiled by nvcc and clang >= 9.0.Alexey Bataev2019-06-191-0/+5
| | | | | | | | | | | | | | | | Summary: The problems with __syncthreads() were fixed in clang >= 9.0 and the original __syncthreads() can be used instead of the ptx instruction. Reviewers: grokos Subscribers: guansong, jdoerfert, openmp-commits, kkwli0, caomhin Tags: #openmp Differential Revision: https://reviews.llvm.org/D63515 llvm-svn: 363807
* New implementation of OpenMP 5.0 detached tasks.Andrey Churbanov2019-06-1912-24/+564
| | | | | | | | Patch by Alex Duran Differential Revision: https://reviews.llvm.org/D62485 llvm-svn: 363799
* [OpenMP] Add task alloc functionGheorghe-Teodor Bercea2019-06-142-0/+16
| | | | | | | | | | | | | | | | Summary: Add the target task allocation function to the interface. Reviewers: ABataev, AlexEichenberger, caomhin, jlpeyton, AndreyChurbanov, RaviNarayanaswamy, hbae Reviewed By: AlexEichenberger, hbae Subscribers: hbae, RaviNarayanaswamy, cfe-commits, Hahnfeld, guansong, jdoerfert, openmp-commits Tags: #openmp, #clang Differential Revision: https://reviews.llvm.org/D63010 llvm-svn: 363449
* Added propagation of not big initial stack size of master thread to workers.Andrey Churbanov2019-06-054-0/+91
| | | | | | | | Currently implemented only for non-Windows 64-bit platforms. Differential Revision: https://reviews.llvm.org/D62488 llvm-svn: 362618
* [OpenMP][libomptarget] Enable usage of unified memory for declare target ↵Gheorghe-Teodor Bercea2019-06-046-2/+39
| | | | | | | | | | | | | | | | | | link variables Summary: This patch enables the usage of a host variable on the device for declare target link variables when unified memory is available. Reviewers: ABataev, caomhin, grokos Reviewed By: grokos Subscribers: Hahnfeld, guansong, jdoerfert, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D60884 llvm-svn: 362505
* Fixed build warning with -DLIBOMP_USE_HWLOC=1Andrey Churbanov2019-06-032-1/+8
| | | | | | | | | | Made type of depth of hwloc object to correapond with change from unsigned in hwloc 1,x to int in hwloc 2.x. This eliminates the warning on signed-unsigned comparison. Differential Revision: https://reviews.llvm.org/D62332 llvm-svn: 362401
* Fix OMP_TARGET_OFFLOAD parsingHansang Bae2019-05-302-3/+65
| | | | | | | | | | | Current parsing allows trailing string after the permitted value, MANDATORY|DISABLED|DEFAULT -- e.g., "mandatorynot" is also recognized as "MANDATORY". Such cases should be recognized as incorrect/unknown value. Differential Revision: https://reviews.llvm.org/D62431 llvm-svn: 362125
* Add checks before pointer dereferencingHansang Bae2019-05-301-1/+5
| | | | | | | | | This change adds checks before dereferencing a pointer returned from a function. Differential Revision: https://reviews.llvm.org/D62224 llvm-svn: 362111
* [openmp] [test] Skip kernel-breaking tests on NetBSDMichal Gorny2019-05-283-0/+13
| | | | | | | | | The omp_taskloop_num_tasks and omp_taskwait have deadlooped on the NetBSD buildbot previously, practically hanging the host running it. Disable them until we can find a good solution, or make the kernel less fragile. llvm-svn: 361825
* Revert "[OPENMP][NVPTX]Fix barriers and parallel level counters, NFC."Alexey Bataev2019-05-243-6/+3
| | | | | | This reverts commit r361421 to split the patch into 3 parts. llvm-svn: 361638
* [OPENMP][NVPTX]Fix barriers and parallel level counters, NFC.Alexey Bataev2019-05-223-3/+6
| | | | | | | | | | | | | | | | | | | | | Summary: Parallel level counter should be volatile to prevent some dangerous optimiations by the ptxas. Otherwise, ptxas optimizations lead to undefined behaviour in some cases. Also, use __threadfence() for #pragma omp flush and if the barrier should not be used (we have only one thread in the team), still perform flush operation since the standard requires implicit flush when executing barriers. Reviewers: gtbercea, kkwli0, grokos Subscribers: guansong, jfb, jdoerfert, openmp-commits, caomhin Tags: #openmp Differential Revision: https://reviews.llvm.org/D62199 llvm-svn: 361421
OpenPOWER on IntegriCloud