3 Commits

Author SHA1 Message Date
Yaxun (Sam) Liu
053dd30bb5 Reland "[HIP] Allow std::malloc in device function"
Reland f5033c37025d as the regression in Tensile was
fixed by ea72a4e6547f.
2023-08-24 19:59:20 -04:00
Yaxun (Sam) Liu
8193b291ce Revert "[HIP] Allow std::malloc in device function"
This reverts commit f5033c37025db46df95a7859d7189d09b5e3433e.

revert this patch since it causes regressions for Tensile. A
reduced test case is:

int main()
{
    std::shared_ptr<float> a;
    a = std::shared_ptr<float>(
        (float*)std::malloc(sizeof(float) * 100),
        std::free
    );
    return 0;
}

Will fix the issue then re-commit.

Fixes: SWDEV-405317
2023-06-14 16:33:30 -04:00
Yaxun (Sam) Liu
f5033c3702 [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
2023-05-23 11:52:52 -04:00