This patch adds basic support for priting the source location and names for the mapped variables. This patch does not support names for custom mappers. This is based on D89802.
|67 ↗||(On Diff #300726)|
Do you think I should change all references from void ** to use some name_t in the runtime? I guess it makes it more obvious what it's supposed to be.
Let's split this:
- introduce ident.h, or source_info.h to be even more descriptive. Only declare source_loc_info_t (or similar) and use it instead of the void*.
- introduce mapped_var_info_t (or similar) and getMappedVariableName(mapped_var_info_t *). Use it everywhere when you extend the interface.
|56 ↗||(On Diff #300726)|
This function is unused. Let's add it with a use. Also, we could make it a constructor while we are at it.
|67 ↗||(On Diff #300726)|
Yeah, that sounds good. While at it, I would make name_t a const char *, though if we hide it anyway it's not that important.
Restructuring code to use type alias wrapper name_t to make it more obvious what the data is beyond a void *. Restructured Ident.h into a class with a constructor, this will have an extra constructor for the OpenMP Ident_t struct once D87946 is merged. Added a routine to print out the declaration site in the table dump using LIBOMPTARGET_INFO. For example, if I seg-fault in an OpenMP region using env LIBOMPTARGET_INFO=2 I will get this output for a sample program.
CUDA device 0 info: Device supports up to 65536 CUDA blocks and 1024 threads with a warp size of 32 Libomptarget device 0 info: Mapping exists (implicit) with HstPtrBegin=0x00007f12ce17a010, TgtPtrBegin=0x00007f12b1000000, Size=0, updated RefCount=2, Name=C Libomptarget device 0 info: Mapping exists (implicit) with HstPtrBegin=0x00007f12e0498010, TgtPtrBegin=0x00007f12ae400000, Size=0, updated RefCount=2, Name=A Libomptarget device 0 info: Mapping exists (implicit) with HstPtrBegin=0x00007f12cf0bd010, TgtPtrBegin=0x00007f12b0000000, Size=0, updated RefCount=2, Name=B CUDA device 0 info: Launching kernel __omp_offloading_fd02_c53ebe3d__Z4gemmIiNSt3__17complexIdEEEvT_S3_S3_T0_PKS4_S3_S3_S6_S3_S3_S4_PS4_S3_S3__l53 with 504 blocks and 128 threads in SPMD mode Libomptarget error: Failed to synchronize device. Libomptarget error: Call to targetDataEnd failed, abort target. Libomptarget error: Failed to process data after launching the kernel. Device 0 Host-Device Pointer Mappings: Host Ptr Target Ptr Size (B) Declaration 0x00007f12ce17a010 0x00007f12b1000000 16000000 matrixC[0:M * N] at gemm.cpp:76:24 0x00007f12cf0bd010 0x00007f12b0000000 16000000 matrixB[0:K * N] at gemm.cpp:75:24 0x00007f12e0498010 0x00007f12ae400000 16000000 matrixA[0:M * K] at gemm.cpp:74:24 0x00007ffd43f2fb58 0x00007f1271c00200 16 beta at kernel.h:34:19 0x00007ffd43f2fb68 0x00007f1271c00000 16 alpha at kernel.h:31:19