summaryrefslogtreecommitdiffstats
path: root/openmp/libomptarget/test
Commit message (Collapse)AuthorAgeFilesLines
* [LIBOMPTARGET] Do not increment/decrement the refcount for "declare target" ↵George Rokos2020-01-141-0/+32
| | | | | | | | objects The reference counter for global objects marked with declare target is INF. This patch prevents the runtime from incrementing /decrementing INF refcounts. Without it, the map(delete: global_object) directive actually deallocates the global on the device. With this patch, such a directive becomes a no-op. Differential Revision: https://reviews.llvm.org/D72525
* [LIBOMPTARGET]Ignore empty target descriptors.Alexey Bataev2020-01-101-0/+17
| | | | | | | | | | | | | | | | | | Summary: If the dynamically loaded module has been compiled with -fopenmp-targets and has no target regions, it has empty target descriptor. It leads to a crash at the runtime if another module has at least one target region and at least one entry in its descriptor. The runtime library is unable to load the empty binary descriptor and terminates the execution. Caused by a clang-offload-wrapper. Reviewers: grokos, jdoerfert Subscribers: caomhin, kkwli0, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D72472
* [OpenMP] build offload plugins before testing themBryan Chan2019-11-281-1/+1
| | | | | | | | | | | | | | | Summary: "make check-all" or "make check-libomptarget" would attempt to run offloading tests before the offload plugins are built. This patch corrects that by adding dependencies to the libomptarget CMake rules. Reviewers: jdoerfert Subscribers: mgorny, guansong, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D70803
* [OpenMP][libomptarget] Add support for close map modifierGheorghe-Teodor Bercea2019-08-093-0/+316
| | | | | | | | | | | | | | | | | | | 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
* [OpenMP][libomptarget] Add support for unified memory for regular mapsGheorghe-Teodor Bercea2019-08-073-1/+279
| | | | | | | | | | | | | | | | | | | 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
* [OPENMP][OFFLOADING]Fix the test, NFC.Alexey Bataev2019-08-061-4/+5
| | | | llvm-svn: 368068
* [OpenMP 5.0] libomptarget interface for declare mapper functions.Michael Kruse2019-08-041-0/+46
| | | | | | | | | | | | | | | | | | 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
* [OPENMP] Resolve lost LoopTripCnt for subsequent loops in same thread.Ron Lieberman2019-07-171-0/+36
| | | | | | | | | | 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
* [OPENMP]Fix threadid in __kmpc_omp_taskwait call for dependent target calls.Alexey Bataev2019-07-161-0/+62
| | | | | | | | | | | | | | | | | 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][libomptarget] Enable requires flags for target libraries.Gheorghe-Teodor Bercea2019-05-211-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [libomptarget] Introduce LIBOMPTARGET_ENABLE_DEBUG cmake option.Michael Kruse2019-03-261-1/+1
| | | | | | | | | | | | | | | | | | | At the moment, support for runtime debug output using the OMPTARGET_DEBUG=1 environment variable is only available with CMAKE_BUILD_TYPE=Debug builds. The patch allows setting it independently using the LIBOMPTARGET_ENABLE_DEBUG option, which is enabled by default depending on CMAKE_BUILD_TYPE. That is, unless this option is set explicitly, nothing changes. This is the same mechanism used by LLVM for LLVM_ENABLE_ASSERTIONS. This patch also removes adding -g -O0 in debug builds, it should be handled by cmake's CMAKE_{C|CXX}_FLAGS_DEBUG configuration option. Idea by Hal Finkel Differential Revision: https://reviews.llvm.org/D55952 llvm-svn: 356998
* [OpenMP] Add omp_get_device_num() and update several other device API functionsJonathan Peyton2019-01-031-0/+36
| | | | | | | | | | | | | | | | | | | | Add omp_get_device_num() function for 5.0 which returns the number of the device the current thread is running on. Currently, we are leaving it to the compiler to handle this properly if it is called inside target. Also, did some cleanup and updating of duplicate device API functions (in both libomp and libomptarget) to make them into weak functions that check for the symbol from libomptarget, and will call the version in libomptarget if it is present. If any additional device API functions are implemented also in libomptarget in the future, we should add the dlsym calls to the host functions. Also, if the omp_target_* functions are to be implemented for the host (this has been requested), they should attempt to call the libomptarget versions as well. Patch by Terry Wilmarth Differential Revision: https://reviews.llvm.org/D55578 llvm-svn: 350352
* [OPENMP] Add the test to check that the libomptarget does not causeAlexey Bataev2018-09-281-1/+7
| | | | | | | | | | infinite loop on removing non-mapped pointer-with-object. Added test to check that libomptarget does not cause infinite loop when trying to unmap the pointer-with-object data that was not previously mapped. llvm-svn: 343344
* [libomptarget-nvptx] Add testing infrastructureJonas Hahnfeld2018-09-282-10/+1
| | | | | | | | | | | | | | | This patch also introduces testing for libomptarget-nvptx which has been missing until now. I propose to add tests for all bugs that are fixed in the future. The target check-libomptarget-nvptx is not run by default because - we can't determine if there is a GPU plugged into the system. - it will require the latest Clang compiler. Keeping compatibility with older releases would prevent testing newer code generation developed in trunk. Differential Revision: https://reviews.llvm.org/D51687 llvm-svn: 343324
* [libomptaret][test] Announce compiler featuresJonas Hahnfeld2018-09-052-0/+6
| | | | | | | | This is a follow-up to r341371: The new test for PR38704 doesn't work with Clang 6.0. It uses an UNSUPPORTED: clang-6, but that hasn't worked because the compiler features weren't known to lit. llvm-svn: 341448
* [libomptarget] PR38704: Fix erase of ShadowPtrMapJonas Hahnfeld2018-09-041-0/+41
| | | | | | | | | | | | | erase() invalidates the iterator and returns a new one pointing to the following element. The code now follows the example at https://en.cppreference.com/w/cpp/container/map/erase. (The added testcase crashes without this patch.) Reported by David Binderman (https://llvm.org/PR38704)! Differential Revision: https://reviews.llvm.org/D51623 llvm-svn: 341371
* [cmake] Fix libomptarget/test/CMakeLists.txtAzharuddin Mohammed2018-07-151-2/+2
| | | | | | | | | | | | | | | | | Summary: Should be variable name instead of variable reference. If the variable is somehow unset, it messes up the if condition expression and causes a CMake error. Reviewers: jlpeyton, AndreyChurbanov, Hahnfeld Reviewed By: Hahnfeld Subscribers: mgorny, llvm-commits, openmp-commits Differential Revision: https://reviews.llvm.org/D47221 llvm-svn: 337133
* [CMake] Detect information about test compilerJonas Hahnfeld2017-11-301-24/+6
| | | | | | | | | | | | Perform a nested CMake invocation to avoid writing our own parser for compiler versions when we are not testing the in-tree compiler. Use the extracted information to mark a test as unsupported that hangs with Clang prior to version 4.0.1 and restrict tests for libomptarget to Clang version 6.0.0 and later. Differential Revision: https://reviews.llvm.org/D40083 llvm-svn: 319448
* [CMake] Refactor testing infrastructureJonas Hahnfeld2017-11-293-100/+21
| | | | | | | | | | | | | | | The code for the two OpenMP runtime libraries was very similar. Move to common CMake file that is included and provides a simple interface for adding testsuites. Also add a common check-openmp target that runs all testsuites that have been registered. Note that this renames all test options to the common OPENMP namespace, for example OPENMP_TEST_C_COMPILER instead of LIBOMP_TEST_COMPILER and so on. Differential Revision: https://reviews.llvm.org/D40082 llvm-svn: 319343
* [CMake] Disallow direct configurationJonas Hahnfeld2017-11-291-1/+1
| | | | | | | | | | As a first step, this allows us to generalize the detection of standalone builds and make it fully compatible when building in llvm/runtimes/ which automatically sets OPENMP_STANDLONE_BUILD. Differential Revision: https://reviews.llvm.org/D40080 llvm-svn: 319341
* [CMake] Re-enable libomptarget and restrict tests to Clang 6.0.0Jonas Hahnfeld2017-11-221-0/+23
| | | | | | | | | | We have just fixed the codegen of omp_is_initial_device() to reliably work when offloading to the same device, see commit r316001. This fixes the failing tests that were the reason why we disabled the library for 5.0. Differential Revision: https://reviews.llvm.org/D39052 llvm-svn: 318847
* [OpenMP] libomptarget: move debugging dumps under control of env var ↵Sergey Dmitriev2017-08-144-3/+53
| | | | | | | | | | | | | | | LIBOMPTARGET_DEBUG Disable default debugging dumps for libomptarget and plugins and move dumps under control of environment variable LIBOMPTARGET_DEBUG=<integer>. Dumps are enabled when LIBOMPTARGET_DEBUG is set to a positive integer value. Debugging dumps are available only in debug build; release build does not support it. Differential Revision: https://reviews.llvm.org/D33227 llvm-svn: 310841
* Whitespace.NAKAMURA Takumi2017-07-201-8/+7
| | | | llvm-svn: 308693
* [OpenMP] libomptarget: test correction for use with OpenMP 4.5George Rokos2017-04-272-2/+2
| | | | | | | | Differential Revision: https://reviews.llvm.org/D32562 Thanks to Sergey Dmitriev for submitting the patch. llvm-svn: 301577
* [OpenMP] Run libomptarget regression tests using all available system threads.George Rokos2017-04-221-1/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D32327 llvm-svn: 301074
* Add AArch64 support.Paul Osmialowski2017-03-062-0/+2
| | | | | | | | This adds AArch64 support to recently added part of the runtime responsible for offloading to target. This piece of code allows offloading-to-self on AArch64 machines. Differential Revision: https://reviews.llvm.org/D30644 llvm-svn: 297070
* [libomptarget] Align test code with runtime/Jonas Hahnfeld2017-02-072-13/+13
| | | | | | | | | | | | | This change allows setting LIBOMPTARGET_LLVM_LIT_EXECUTABLE and LIBOMPTARGET_FILECHECK_EXECUTABLE as full path. It also honors OPENMP_LLVM_TOOLS_DIR which is meant as a common configuration for both libomp and libomptarget. Maybe this should be done in a common CMake module, but I'm no expert here. Differential Revision: https://reviews.llvm.org/D29172 llvm-svn: 294284
* [OpenMP] Initial implementation of OpenMP offloading library - libomptarget.George Rokos2017-01-255-0/+273
This is the patch upstreaming the device-agnostic part of libomptarget. Differential Revision: https://reviews.llvm.org/D14031 llvm-svn: 293094
OpenPOWER on IntegriCloud