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 : {
20 2 : return rtSubscribeReport(threadId, (rtStream_t)stream);
21 : }
22 :
23 4 : aclError aclrtLaunchCallback(aclrtCallback fn, void* userData, aclrtCallbackBlockType blockType, aclrtStream stream)
24 : {
25 4 : if ((blockType != ACL_CALLBACK_BLOCK) && (blockType != ACL_CALLBACK_NO_BLOCK)) {
26 1 : ACL_LOG_INNER_ERROR("invalid block type, the current blockType = %d", blockType);
27 1 : return ACL_ERROR_INVALID_PARAM;
28 : }
29 3 : return rtCallbackLaunch((rtCallback_t)(fn), userData, (rtStream_t)(stream), (blockType == ACL_CALLBACK_BLOCK));
30 : }
31 :
32 2 : aclError aclrtProcessReport(int32_t timeout) { return rtProcessReport(timeout); }
33 :
34 2 : aclError aclrtUnSubscribeReport(uint64_t threadId, aclrtStream stream)
35 : {
36 2 : return rtUnSubscribeReport(threadId, (rtStream_t)(stream));
37 : }
38 :
39 : #if defined(__cplusplus)
40 : }
41 : #endif
|