/* * Copyright (c) Advanced Micro Devices, Inc., or its affiliates. * * SPDX-License-Identifier: MIT */ #include #include #include "hipMalloc.h" int MallocFunc() { int* Ad; hipError_t err; err = hipMalloc(reinterpret_cast(&Ad), 1024); if (err == hipSuccess) { std::cout << "hipMalloc PASSED!" << std::endl; err = hipFree(Ad); if (err == hipSuccess) { std::cout << "hipFree PASSED!" << std::endl; return 1; } else { std::cout << "hipFree FAILED!" << std::endl; return 0; } } else { std::cout << "hipMalloc FAILED!" << std::endl; return 0; } }