[all-commits] [llvm/llvm-project] f5033c: [HIP] Allow std::malloc in device function

Yaxun (Sam) Liu via All-commits all-commits at lists.llvm.org
Tue May 23 08:53:29 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f5033c37025db46df95a7859d7189d09b5e3433e
  Author: Yaxun (Sam) Liu <yaxun.liu at amd.com>
  Date:   2023-05-23 (Tue, 23 May 2023)

  Changed paths:
    M clang/lib/Headers/__clang_hip_runtime_wrapper.h
    M clang/test/Headers/Inputs/include/cstdlib
    M clang/test/Headers/Inputs/include/math.h
    A clang/test/Headers/Inputs/include/sstream
    A clang/test/Headers/Inputs/include/stdexcept
    M clang/test/Headers/hip-header.hip

  Log Message:
  [HIP] Allow std::malloc in device function

D106463 caused a regression that prevents std::malloc to be
called in the device function, which is allowed with nvcc.

Basically the standard C++ header introducing malloc in
std namespace by using ::malloc. The device ::malloc
function needs to be declared before using ::malloc
to be introduced into std namespace.

Revert D106463 and add a test.

Reviewed by: Artem Belevich

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

More information about the All-commits mailing list