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.
Why were these functions removed? It does not seem related to the changes in the patch?