[all-commits] [llvm/llvm-project] b6c2f5: [OpenMP] Add allocator support for target memory

Hansang Bae via All-commits all-commits at lists.llvm.org
Tue Mar 2 14:46:22 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b6c2f538b22b4053ce10cfa6cf60c5244df202ac
      https://github.com/llvm/llvm-project/commit/b6c2f538b22b4053ce10cfa6cf60c5244df202ac
  Author: Hansang Bae <hansang.bae at intel.com>
  Date:   2021-03-02 (Tue, 02 Mar 2021)

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

  Log Message:
  -----------
  [OpenMP] Add allocator support for target memory

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

llvm_omp_target_alloc_host(size_t size, int device_num);
-- Returns non-migratable memory owned by host.
-- Memory is accessible by host and device(s).

llvm_omp_target_alloc_shared(size_t size, int device_num);
-- Returns migratable memory owned by host and device.
-- Memory is accessible by host and device.

llvm_omp_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
-- llvm_omp_target_host_mem_space
-- llvm_omp_target_shared_mem_space
-- llvm_omp_target_device_mem_space
-- llvm_omp_target_host_mem_alloc
-- llvm_omp_target_shared_mem_alloc
-- llvm_omp_target_device_mem_alloc

Differential Revision: https://reviews.llvm.org/D96669




More information about the All-commits mailing list