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
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