diff --git a/npu_loss_scale_ops_declare.cc b/npu_loss_scale_ops_declare.cc new file mode 100644 index 0000000..5ff7ccd --- /dev/null +++ b/npu_loss_scale_ops_declare.cc @@ -0,0 +1,49 @@ +/** + * Copyright 2019 Huawei Technologies Co., Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "transform/graph_ir/op_declare/npu_loss_scale_ops_declare.h" + +namespace mindspore::transform { +// NPUGetFloatStatus +INPUT_MAP(NPUGetFloatStatus) = {{1, INPUT_DESC(addr)}}; +// ÊäÈëÓ³É䣬addrË÷ÒýΪ1 +OUTPUT_MAP(NPUGetFloatStatus) = {{0, OUTPUT_DESC(data)}}; +// Êä³öÓ³É䣬dataË÷ÒýΪ0 +ATTR_MAP(NPUGetFloatStatus) = EMPTY_ATTR_MAP; +//ÊôÐÔÓ³É䣬¿Õ +REG_ADPT_DESC(NPUGetFloatStatus, kNameNPUGetFloatStatus, ADPT_DESC(NPUGetFloatStatus)) +// ×¢²áNPUGetFloatStatus²Ù×÷µÄÊÊÅäÆ÷ÃèÊökNameNPUGetFloatStatus + +// NPUAllocFloatStatus +INPUT_MAP(NPUAllocFloatStatus) = EMPTY_INPUT_MAP; +// ÊäÈëÓ³É䣬¿Õ +ATTR_MAP(NPUAllocFloatStatus) = EMPTY_ATTR_MAP; +// ÊôÐÔÓ³É䣬¿Õ +OUTPUT_MAP(NPUAllocFloatStatus) = {{0, OUTPUT_DESC(data)}}; +// Êä³öÓ³É䣬dataË÷ÒýΪ0 +REG_ADPT_DESC(NPUAllocFloatStatus, kNameNPUAllocFloatStatus, ADPT_DESC(NPUAllocFloatStatus)) +// ×¢²áNPUAllocFloatStatus²Ù×÷µÄÊÊÅäÆ÷ÃèÊökNameNPUAllocFloatStatus + +// NPUClearFloatStatus +INPUT_MAP(NPUClearFloatStatus) = {{1, INPUT_DESC(addr)}}; +// ÊäÈëÓ³É䣬addrË÷ÒýΪ1 +OUTPUT_MAP(NPUClearFloatStatus) = {{0, OUTPUT_DESC(data)}}; +// Êä³öÓ³É䣬dataË÷ÒýΪ0 +ATTR_MAP(NPUClearFloatStatus) = EMPTY_ATTR_MAP; +//ÊôÐÔÓ³É䣬¿Õ +REG_ADPT_DESC(NPUClearFloatStatus, kNameNPUClearFloatStatus, ADPT_DESC(NPUClearFloatStatus)) +// ×¢²áNPUClearFloatStatus²Ù×÷µÄÊÊÅäÆ÷ÃèÊökNameNPUClearFloatStatus +} // namespace mindspore::transform