REGISTER_CUSTOM_PASS

Applicability

Product

Supported or Not

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

Header File/Library File

  • Header file: #include <register/register_custom_pass.h>
  • Library file: libregister.so

Function Usage

Developers can register the graph modification function with the framework. The framework calls the custom graph modification pass at the beginning of build and calls REGISTER_CUSTOM_PASS to register the custom pass.

Prototype

1
REGISTER_CUSTOM_PASS(name) 

Parameters

Parameter

Input/Output

Description

name

Input

Name of a custom pass.

Returns

None

Constraints

The call starts with REGISTER_CUSTOM_PASS and uses periods (.) to connect APIs such as CustomPassFn. Example:

1
2
#include "register/register_custom_pass.h"
REGISTER_CUSTOM_PASS("pass_name").CustomPassFn(CustomPassFunc);