Issue 173070
Summary OpenMP V&V 5.2/declare_mapper/test_declare_mapper_present.c regression by #153683
Labels new issue
Assignees
Reporter Meinersbur
    The OpenMP Validation&Verification test [https://github.com/OpenMP-Validation-and-Verification/OpenMP_VV/blob/master/tests/5.2/declare_mapper/test_declare_mapper_present.c] stopped working after 1fbf33cd4039d7fe97a20d8885c0f26fc441cf5e. The option `LIBOMPTARGET_TREAT_ATTACH_AUTO_AS_ALWAYS=0` does not fix it either.

1fbf33cd4039d7fe97a20d8885c0f26fc441cf5e^ (before #153683):
```
test_declare_mapper_present.c.o: PASS. exit code: 0
test_declare_mapper_present.c.o:
[OMPVV_INFO: test_declare_mapper_present.c:74] Test is running on device.
[OMPVV_INFO: test_declare_mapper_present.c:50] test_declare_mapper_present
[OMPVV_INFO: test_declare_mapper_present.c:80] The value of errors is 0.
[OMPVV_RESULT: test_declare_mapper_present.c] Test passed on the device.
====COMPILE AND RUN DONE====
```

1fbf33cd4039d7fe97a20d8885c0f26fc441cf5e  (with #153683):
```
test_declare_mapper_present.c.o: FAIL. exit code: 134
test_declare_mapper_present.c.o:
omptarget message: explicit extension not allowed: host address specified is 0x00007ffc946f5bd8 (16 bytes), but device allocation maps to host at 0x00007ffc946f5bd8 (8 bytes)
omptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x00007ffc946f5bd8 (16 bytes)
omptarget error: Call to getTargetPointer returned null pointer ('present' map type modifier).
omptarget error: Call to targetDataBegin via targetDataMapper for custom mapper failed
omptarget error: Call to targetDataBegin failed, abort target.
omptarget error: Failed to process data before launching the kernel.
omptarget error: Consult https://openmp.llvm.org/design/Runtimes.html for debugging options.
omptarget error: Source location information not present. Compile with -g or -gline-tables-only.
omptarget fatal error 1: failure of target construct while offloading is mandatory
timeout: the monitored command dumped core
====COMPILE AND RUN DONE====
```

<details>
<Summary>with `LIBOMPTARGET_DEBUG=1 LIBOMPTARGET_INFO=-1`</Summary>
Native Vector Width For Short: 1
Native Vector Width For Int: 1
Native Vector Width For Long: 1
Native Vector Width For Half: 0

Type: GPU
Max Work Size Per Dimension: {x: 2147483647, y: 65535, z: 65535}
Vendor ID: 4130
Num Compute Units: 104
Max Clock Frequency: 1700 MHz
Memory Clock Rate: 1600 MHz
Address Bits: 64
Max Mem Allocation Size: 68702699520 B
Global Mem Size: 68702699520 B
Work Group Shared Mem Size: 65536 B
Single Precision Floating Point Capability: 127 { CORRECTLY_ROUNDED_DIVIDE_SQRT ROUND_TO_NEAREST ROUND_TO_ZERO ROUND_TO_INF INF_NAN DENORM FMA }
Double Precision Floating Point Capability: 127 { CORRECTLY_ROUNDED_DIVIDE_SQRT ROUND_TO_NEAREST ROUND_TO_ZERO ROUND_TO_INF INF_NAN DENORM FMA }
Half Precision Floating Point Capability: 0 { }
Native Vector Width For Char: 1
Native Vector Width For Short: 1
Native Vector Width For Int: 1
Native Vector Width For Long: 1
Native Vector Width For Float: 1
Native Vector Width For Double: 1
Native Vector Width For Half: 0
PluginInterface --> Node address 0x1fd10c0, target pointer 0x7f74fb19c000, size 8
t=1, HoldRefCount=0, Name=unknown
omptarget --> Notifying about new mapping: HstPtr=0x0000000001fd4ba0, Size=4000
omptarget --> Moving 4000 bytes (hst:0x0000000001fd4ba0) -> (tgt:0x00007f72ec802000)
omptarget --> Copying data from host to device, HstPtr=0x0000000001fd4ba0, TgtPtr=0x00007f72ec802000, Size=4000, Name=unknown
omptarget --> Call to omp_get_num_devices returning 2
omptarget --> Call to omp_get_initial_device returning 2
PluginInterface --> MemoryManagerTy::allocate: size 4000 with host pointer 0x0.
PluginInterface --> findBucket: Size 4000 is floored to 2048.
PluginInterface --> Cannot find a node in the FreeLists. Allocate on device.
PluginInterface --> Node address 0x1fd3460, target pointer 0x7f74fb19a000, size 4000
omptarget --> There are 4000 bytes allocated at target address 0x00007f72ec802000 - is new
omptarget --> Deferring ATTACH map-type processing for argument 2
omptarget --> Tracked 2 total new allocations:  Host ptr: 0x0000000001fd4ba0, Size: 4000 bytes  Host ptr: 0x00007ffd4f5058d8, Size: 8 bytes
omptarget --> Processing 1 deferred ATTACH map entries
omptarget --> Treating ATTACH(auto) as ATTACH(always) because LIBOMPTARGET_TREAT_ATTACH_AUTO_AS_ALWAYS is true
omptarget --> Processing ATTACH entry 0: HstPtr=0x00007ffd4f5058e0, HstPteeBegin=0x0000000001fd4ba0, PtrSize=8, MapType=0x4000
omptarget --> Looking up mapping(HstPtrBegin=0x0000000001fd4ba0, Size=0)...
omptarget --> Mapping exists with HstPtrBegin=0x0000000001fd4ba0, TgtPtrBegin=0x00007f72ec802000, Size=0, DynRefCount=1 (update suppressed), HoldRefCount=0
omptarget --> Attach pointee lookup - IsPresent=yes, IsHostPtr=no
omptarget --> Looking up mapping(HstPtrBegin=0x00007ffd4f5058e0, Size=8)...
omptarget --> Attach pointer lookup - IsPresent=no, IsHostPtr=no
omptarget --> Skipping ATTACH entry 0: pointer not present on device
PluginInterface --> MemoryManagerTy::free: target memory 0x7f74fb19c000.
PluginInterface --> findBucket: Size 8 is floored to 8.
PluginInterface --> Found its node 0x1fd10c0. Insert it to bucket 2.
PluginInterface --> MemoryManagerTy::free: target memory 0x7f74fb19a000.
PluginInterface --> findBucket: Size 4000 is floored to 2048.
PluginInterface --> Found its node 0x1fd3460. Insert it to bucket 10.
omptarget --> OpenMP Host-Device pointer mappings after block at unknown:0:0:
omptarget --> Host Ptr           Target Ptr         Size (B) DynRefCount HoldRefCount Declaration
omptarget --> 0x0000000001fd4ba0 0x00007f72ec802000 4000     1           0            unknown at unknown:0:0
omptarget --> 0x00007ffd4f5058d8 0x00007f72ec801000 8        1 0            unknown at unknown:0:0
omptarget --> OpenMP Host-Device pointer mappings table empty
omptarget --> Entering target region for device -1 with entry point 0x0000000000203560
omptarget --> Use default device id 0
omptarget --> Call to omp_get_num_devices returning 2
omptarget --> Call to omp_get_initial_device returning 2
omptarget --> Entering OpenMP kernel at unknown:0:0 with 1 arguments:
omptarget --> tofrom(unknown)[16] (implicit)
omptarget --> Entry 0: Base=0x00007ffd4f5058d8, Begin=0x00007ffd4f5058d8, Size=16, Type=0x223, Name=unknown
omptarget --> loop trip count is 0
omptarget --> Calling targetDataMapper for the 0th argument
omptarget --> Calling the mapper function 0x0000000000204c50
omptarget --> __tgt_mapper_num_components(Handle=0x00007ffd4f504860) returns 0
omptarget --> __tgt_push_mapper_component(Handle=0x00007ffd4f504860) adds an entry (Base=0x00007ffd4f5058d8, Begin=0x00007ffd4f5058d8, Size=16, Type=0x1000, Name=unknown)
omptarget --> __tgt_push_mapper_component(Handle=0x00007ffd4f504860) adds an entry (Base=0x00007ffd4f5058d8, Begin=0x00007ffd4f5058d8, Size=16, Type=0x1000000001006, Name=unknown)
omptarget --> __tgt_push_mapper_component(Handle=0x00007ffd4f504860) adds an entry (Base=0x00007ffd4f5058d8, Begin=0x00007ffd4f5058d8, Size=8, Type=0x1000000001006, Name=unknown)
omptarget --> __tgt_push_mapper_component(Handle=0x00007ffd4f504860) adds an entry (Base=0x00007ffd4f5058e0, Begin=0x0000000001fd4ba0, Size=4000, Type=0x1000000001016, Name=unknown)
omptarget --> Looking up mapping(HstPtrBegin=0x00007ffd4f5058d8, Size=16)...
omptarget --> WARNING: Pointer is already mapped but section extends beyond mapped region
omptarget message: explicit extension not allowed: host address specified is 0x00007ffd4f5058d8 (16 bytes), but device allocation maps to host at 0x00007ffd4f5058d8 (8 bytes)
omptarget message: device mapping required by 'present' map type modifier does not exist for host address 0x00007ffd4f5058d8 (16 bytes)
omptarget --> Call to getTargetPointer returned null pointer ('present' map type modifier).
omptarget --> Call to targetDataBegin via targetDataMapper for custom mapper failed
omptarget --> Call to targetDataBegin failed, abort target.
omptarget --> Failed to process data before launching the kernel.
omptarget --> OpenMP Host-Device pointer mappings after block at unknown:0:0:
omptarget --> Host Ptr Target Ptr         Size (B) DynRefCount HoldRefCount Declaration
omptarget --> 0x0000000001fd4ba0 0x00007f72ec802000 4000     1           0 unknown at unknown:0:0
omptarget --> 0x00007ffd4f5058d8 0x00007f72ec801000 8 1           0            unknown at unknown:0:0
omptarget --> OpenMP Host-Device pointer mappings table empty
omptarget error: Source location information not present. Compile with -g or -gline-tables-only.
omptarget fatal error 1: failure of target construct while offloading is mandatory
timeout: the monitored command dumped core
</details>

Clang flags:
```sh
-I./ompvv -lm -O2 -fopenmp --offload-arch=gfx90a -fopenmp-version=52 -DVERBOSE_MODE=1 OpenMP_VV/tests/5.2/declare_mapper/test_declare_mapper_present.c -o bin/test_declare_mapper_present.c.o
```

Device info:
```sh
$ bin/llvm-offload-device-info
Name: gfx90a
Product Name: AMD Instinct MI210
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to