Line data Source code
1 : /** 2 : * Copyright (c) 2025 Huawei Technologies Co., Ltd. 3 : * This program is free software, you can redistribute it and/or modify it under the terms and conditions of 4 : * CANN Open Software License Agreement Version 2.0 (the "License"). 5 : * Please refer to the License for details. You may not use this file except in compliance with the License. 6 : * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, 7 : * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. 8 : * See LICENSE in the root of the software repository for the full text of the License. 9 : */ 10 : #include "acl/acl_rt.h" 11 : #include "log_inner.h" 12 : #include "runtime/kernel.h" 13 : 14 : #ifdef __cplusplus 15 : extern "C" { 16 : #endif 17 : 18 2 : aclError aclrtSubscribeReport(uint64_t threadId, aclrtStream stream) { 19 2 : return rtSubscribeReport(threadId, (rtStream_t)stream); 20 : } 21 : 22 4 : aclError aclrtLaunchCallback(aclrtCallback fn, void *userData, 23 : aclrtCallbackBlockType blockType, 24 : aclrtStream stream) { 25 4 : if ((blockType != ACL_CALLBACK_BLOCK) && 26 : (blockType != ACL_CALLBACK_NO_BLOCK)) { 27 1 : ACL_LOG_INNER_ERROR("invalid block type, the current blockType = %d", 28 : blockType); 29 1 : return ACL_ERROR_INVALID_PARAM; 30 : } 31 3 : return rtCallbackLaunch((rtCallback_t)(fn), userData, (rtStream_t)(stream), 32 : (blockType == ACL_CALLBACK_BLOCK)); 33 : } 34 : 35 2 : aclError aclrtProcessReport(int32_t timeout) { 36 2 : return rtProcessReport(timeout); 37 : } 38 : 39 2 : aclError aclrtUnSubscribeReport(uint64_t threadId, aclrtStream stream) { 40 2 : return rtUnSubscribeReport(threadId, (rtStream_t)(stream)); 41 : } 42 : 43 : #if defined(__cplusplus) 44 : } 45 : #endif