summaryrefslogtreecommitdiff
path: root/offload/test/mapping
AgeCommit message (Collapse)Author
2025-11-06[Offload] Remove handling for device memory pool (#163629)Joseph Huber
Summary: This was a lot of code that was only used for upstream LLVM builds of AMDGPU offloading. We have a generic and fast `malloc` in `libc` now so just use that. Simplifies code, can be added back if we start providing alternate forms but I don't think there's a single use-case that would justify it yet.
2025-10-22[OpenMP] Adds omp_target_is_accessible routine (#138294)Nicole Aschenbrenner
Adds omp_target_is_accessible routine. Refactors common code from omp_target_is_present to work for both routines. --------- Co-authored-by: Shilei Tian <i@tianshilei.me>
2025-10-21[NFC][OpenMP] Update a test that was failing on aarch64. (#164456)Abhinav Gaba
The failure was reported here: https://github.com/llvm/llvm-project/pull/164039#issuecomment-3425429556 The test was checking for the "bad" behavior so as to keep track of it, but there seem to be some issues with the pointer arithmetic specific to aarch64. The update for now is to not check for the "bad" behavior fully. We may need to debug further if similar issues are encountered eventually once the codegen has been fixed.
2025-10-20[NFC][OpenMP] Add small class-member use_device_ptr/addr unit tests. (#164039)Abhinav Gaba
Two of the tests are currently asserting, and two are emitting unexpected results. The asserting tests will be fixed using the ATTACH-style codegen from #153683. The other two involve `use_device_addr` on byrefs, and need more follow-up codegen changes, that have been noted in a FIXME comment.
2025-09-29[OpenMP] Mark problematic tests as XFAIL / UNSUPPORTED (#161267)Joseph Huber
Summary: Several of these tests have been failing for literal years. Ideally we make efforts to fix this, but keeping these broken has had serious consequences on our testing infrastructure where failures are the norm so almost all test failures are disregarded. I made a tracking issue for the ones that have been disabled. https://github.com/llvm/llvm-project/issues/161265
2025-09-08[OpenMP] Add tests for mapping of chained 'containing' structs (#156703)Julian Brown
This PR adds several new tests for mapping of chained structures, i.e. those resembling: #pragma omp target map(tofrom: a->b->c) These are currently XFAILed, although the first two tests actually work with unified memory -- I'm not sure if it's possible to easily improve the condition on the XFAILs in question to make them more accurate. These cases are all fixed by the WIP PR https://github.com/llvm/llvm-project/pull/153683.
2025-08-28[Offload][OpenMP] Tests require libc on GPU for printf (#155785)Jan Patrick Lehr
These tests currently fail when libc is not configured to be built as they require printf to be available in target regions.
2025-08-25[NFC][OpenMP] Add several use_device_ptr/addr tests. (#154939)Abhinav Gaba
Most tests are either compfailing or runfailing. They should start passing once we start using ATTACH map-type based codegen. (#153683) Even after they start passing, there are a few places where the EXPECTED and actual CHECKs are different, due to two main issues: * use_device_ptr translation on `&p[0]` is not succeeding in looking-up a previously mapped `&p[1]` * privatization of byref use_device_addr operands is not happening correctly. The above should be fixed as separate standalone changes.
2025-08-14[NFC][Offload] Add missing maps to OpenMP offloading tests. (#153103)Abhinav Gaba
A few tests were only mapping a pointee, like: `map(pp[0][0])`, on an `int** pp`, but expecting the pointers, like `pp`, `pp[0]` to also be mapped, which is incorrect. This change fixes six such tests.
2025-07-08[NFC][OpenMP] Add tests for mapping pointers and their dereferences. (#146934)Abhinav Gaba
The output of the compile-and-run tests is incorrect. These will be used for reference in future commits that resolve the issues. Also updated the existing clang LIT test, target_map_both_pointer_pointee_codegen.cpp, with more constructs and fewer CHECKs (through more update_cc_test_checks filters).
2025-06-29[OpenMP] Fix crash with duplicate mapping on target directive (#146136)Julian Brown
OpenMP allows duplicate mappings, i.e. in OpenMP 6.0, 7.9.6 "map Clause": Two list items of the map clauses on the same construct must not share original storage unless one of the following is true: they are the same list item [or other omitted reasons]" Duplicate mappings can arise as a result of user-defined mapper processing (which I think is a separate bug, and is not addressed here), but also in straightforward cases such as: #pragma omp target map(tofrom: s.mem[0:10]) map(tofrom: s.mem[0:10]) Both these cases cause crashes at runtime at present, due to an unfortunate interaction between reference counting behaviour and shadow pointer handling for blocks. This is what happens: 1. The member "s.mem" is copied to the target 2. A shadow pointer is created, modifying the pointer on the target 3. The member "s.mem" is copied to the target again 4. The previous shadow pointer metadata is still present, so the runtime doesn't modify the target pointer a second time. The fix is to disable step 3 if we've already done step 2 for a given block that has the "is new" flag set.
2025-06-11[Clang][OpenMP] Fix mapping of arrays of structs with members with mappers ↵Abhinav Gaba
(#142511) This builds upon #101101 from @jyu2-git, which used compiler-generated mappers when mapping an array-section of structs with members that have user-defined default mappers. Now we do the same when mapping arrays of structs.
2025-01-31[Offload][NFC] Fix typos discovered by codespell (#125119)Christian Clauss
https://github.com/codespell-project/codespell % `codespell --ignore-words-list=archtype,hsa,identty,inout,iself,nd,te,ths,vertexes --write-changes`
2024-12-01FIX: Fix test failure in offload/test/mapping/power_of_two_alignment.cShilei Tian
A C file with `template` in it. Awesome.
2024-12-01[NFC][Offload] Correct the compile command of two C test files (#118243)Shilei Tian
The compile command for the two C test files are `compilexx`, which is actually for C++ compilation.
2024-09-03[Offload] Change x86_64-pc-linux to x86_64-unknown-linux (#107023)Jan Patrick Lehr
It appears that the RUNTIMES build prefers the x86-64-unknown-linux-gnu triple notation for the host. This fixes runtime / test breakages when compiler-rt is used as the CLANG_DEFAULT_RTLIB.
2024-08-02Test faild with amd. (#101781)jyu2-git
Add unspport. This is relate #101101
2024-08-02[OpenMP] Generate implicit default mapper for mapping array section. (#101101)jyu2-git
This is only for struct containing nested structs with user defined mappers. Add four functions: 1>buildImplicitMap: build map for default mapper 2>buildImplicitMapper: build default mapper. 3>hasUserDefinedMapper for given mapper name and mapper type, lookup user defined map, if found one return true. 4>isImplicitMapperNeeded check if Mapper is needed During create map, in checkMappableExpressionList, call isImplicitMapperNeeded when it return true, call buildImplicitMapper to generate implicit mapper and added to map clause. https://github.com/llvm/llvm-project/pull/101101
2024-07-10[Offload][test]Fix typo of requires (#98327)Jinsong Ji
Typos in 8823448807f3b1a1362d1417e062d763734e02f5.
2024-07-03[Clang][OpenMP] This is addition fix for #92210. (#94802)jyu2-git
Fix another runtime problem when explicit map both pointer and pointee in target data region. In #92210, problem is only addressed in target region, but missing for target data region. The change just passing AreBothBasePtrAndPteeMapped in generateInfoForComponentList when processing target data. --------- Co-authored-by: Alexey Bataev <a.bataev@gmx.com>
2024-06-29[Offload] Refactor offload test requirements (#95196)Ethan Luis McDonough
Many tests in the `offload` project have requirements defined by which targets are not supported rather than which platforms are supported. This patch aims to streamline the requirement definitions by adding four new feature tags: `host`, `gpu`, `amdgpu`, and `nvidiagpu`.
2024-05-17[Offload][NFC] Remove all trailing whitespace from offload/ (#92578)Joseph Huber
Summary: This patch cleans up the training whitespace in a bunch of tests and CMake files. Most just in preparation for other cleanups.
2024-05-15[Clang][OpenMP] Fix runtime problem when explicit map both pointer and ↵jyu2-git
pointee (#92210) ponter int *p for following map, test currently crash. map(p, p[:100]) or map(p, p[1]) Currly IR looks like // &p, &p, sizeof(int), TARGET_PARAM | TO | FROM // &p, p[0], 100sizeof(float) TO | FROM Worrking IR is // map(p, p[0:100]) to map(p[0:100]) // &p, &p[0], 100*sizeof(float), TARGET_PARAM | TO | FROM | PTR_AND_OBJ The change is add new argument AreBothBasePtrAndPteeMapped in generateInfoForComponentList Use that to skip map for map(p), when processing map(p[:100]) generate map with right flag.
2024-04-22[Offload] Move `/openmp/libomptarget` to `/offload` (#75125)Johannes Doerfert
In a nutshell, this moves our libomptarget code to populate the offload subproject. With this commit, users need to enable the new LLVM/Offload subproject as a runtime in their cmake configuration. No further changes are expected for downstream code. Tests and other components still depend on OpenMP and have also not been renamed. The results below are for a build in which OpenMP and Offload are enabled runtimes. In addition to the pure `git mv`, we needed to adjust some CMake files. Nothing is intended to change semantics. ``` ninja check-offload ``` Works with the X86 and AMDGPU offload tests ``` ninja check-openmp ``` Still works but doesn't build offload tests anymore. ``` ls install/lib ``` Shows all expected libraries, incl. - `libomptarget.devicertl.a` - `libomptarget-nvptx-sm_90.bc` - `libomptarget.rtl.amdgpu.so` -> `libomptarget.rtl.amdgpu.so.18git` - `libomptarget.so` -> `libomptarget.so.18git` Fixes: https://github.com/llvm/llvm-project/issues/75124 --------- Co-authored-by: Saiyedul Islam <Saiyedul.Islam@amd.com>