[Openmp-commits] [PATCH] D96669: [OpenMP] Add allocator support for target memory

Hansang Bae via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sun Feb 14 13:41:14 PST 2021


hbae created this revision.
hbae added reviewers: grokos, AndreyChurbanov.
hbae added a project: OpenMP.
Herald added subscribers: guansong, yaxunl.
hbae requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.

This is a preview of allocator support for target memory that depends on the
offload runtime API which allocates memory as described below.

`preomp_target_alloc_host(size_t size, int device_num);`

- Returns non-migratable memory owned by host.
- Memory is accessible by host and device(s).

`preomp_target_alloc_shared(size_t size, int device_num);`

- Returns migratable memory owned by host and device.
- Memory is accessible by host and device.

`preomp_target_alloc_device(size_t size, int device_num);`

- Returns memory owned by device.
- Memory is only accessible by device.

New memory space and predefined allocator names are

- `preomp_target_host_mem_space`
- `preomp_target_shared_mem_space`
- `preomp_target_device_mem_space`
- `preomp_target_host_mem_alloc`
- `preomp_target_shared_mem_alloc`
- `preomp_target_device_mem_alloc`


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96669

Files:
  openmp/runtime/src/dllexports
  openmp/runtime/src/include/omp.h.var
  openmp/runtime/src/include/omp_lib.f90.var
  openmp/runtime/src/include/omp_lib.h.var
  openmp/runtime/src/kmp.h
  openmp/runtime/src/kmp_alloc.cpp
  openmp/runtime/src/kmp_global.cpp
  openmp/runtime/src/kmp_runtime.cpp
  openmp/runtime/src/kmp_stub.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96669.323632.patch
Type: text/x-patch
Size: 16765 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210214/26d48113/attachment-0001.bin>


More information about the Openmp-commits mailing list