* Copyright (c) 2025 Huawei Technologies Co., Ltd.
* This program is free software, you can redistribute it and/or modify it under the terms and conditions of
* CANN Open Software License Agreement Version 2.0 (the "License").
* Please refer to the License for details. You may not use this file except in compliance with the License.
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
* See LICENSE in the root of the software repository for the full text of the License.
*/
#include <iostream>
#include <vector>
#include <unistd.h>
#include <string>
#include "acl/acl.h"
#include "acl/acl_prof.h"
int main(int argc, char *argv[]) {
uint32_t deviceIdList[1] = {0};
aclrtStream stream = nullptr;
aclInit(nullptr);
aclrtSetDevice(deviceIdList[0]);
aclrtCreateStream(&stream);
std::string aclProfPath = "./output";
aclprofInit(aclProfPath.c_str(), aclProfPath.length());
aclprofConfig *config = aclprofCreateConfig(deviceIdList, 1, ACL_AICORE_ARITHMETIC_UTILIZATION,
nullptr, ACL_PROF_ACL_API | ACL_PROF_TASK_TIME | ACL_PROF_AICORE_METRICS | ACL_PROF_AICPU | ACL_PROF_L2CACHE | ACL_PROF_HCCL_TRACE | ACL_PROF_MSPROFTX | ACL_PROF_RUNTIME_API);
std::string memFreq = "15";
aclError ret = aclprofSetConfig(ACL_PROF_SYS_HARDWARE_MEM_FREQ, memFreq.c_str(), memFreq.length());
aclprofStart(config);
aclprofStop(config);
aclprofDestroyConfig(config);
aclprofFinalize();
aclrtDestroyStream(stream);
aclrtResetDeviceForce(deviceIdList[0]);
aclFinalize();
return 0;
}