openmp: Add support for HBW or large capacity or interleaved memory through the libme...
authorJakub Jelinek <jakub@redhat.com>
Thu, 9 Jun 2022 08:14:42 +0000 (10:14 +0200)
committerJakub Jelinek <jakub@redhat.com>
Thu, 9 Jun 2022 08:14:42 +0000 (10:14 +0200)
commit17f52a1c725948befcc3dd3c90d1abad77b6f6fe
tree4b63c1bca261493511c7e806b60f289edfd738c2
parent269edf4e5e6ab489730038f7e3495550623179fe
openmp: Add support for HBW or large capacity or interleaved memory through the libmemkind.so library

This patch adds support for dlopening libmemkind.so on Linux and uses it
for some kinds of allocations (but not yet e.g. pinned memory).

2022-06-09  Jakub Jelinek  <jakub@redhat.com>

* allocator.c: Include dlfcn.h if LIBGOMP_USE_MEMKIND is defined.
(enum gomp_memkind_kind): New type.
(struct omp_allocator_data): Add memkind field if LIBGOMP_USE_MEMKIND
is defined.
(struct gomp_memkind_data): New type.
(memkind_data, memkind_data_once): New variables.
(gomp_init_memkind, gomp_get_memkind): New functions.
(omp_init_allocator): Initialize data.memkind, don't fail for
omp_high_bw_mem_space if libmemkind supports it.
(omp_aligned_alloc, omp_free, omp_aligned_calloc, omp_realloc): Add
memkind support of LIBGOMP_USE_MEMKIND is defined.
* config/linux/allocator.c: New file.
libgomp/allocator.c
libgomp/config/linux/allocator.c [new file with mode: 0644]