SyncResInfo

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
/*
 * Input parameters:
 *  type: resource type, which identifies a synchronization resource type (such as event synchronization, memory synchronization, or computing synchronization).
 *  name: resource name (or type name). If reuse_key is empty, this field is used as a resource reuse key.
 *  reuse_key: resource reuse key. Resources with the same key are reused (shared) to optimize resource allocation and reduce redundant creation.
 *  required: whether a resource is mandatory. If the value is true, the resource must be successfully allocated. Otherwise, the operator verification fails.
 *
 * Output parameter description:
 *  is_valid: resource allocation validity status. The value true indicates that the resource has been successfully allocated and is available. The value false indicates that the allocation fails or is not performed.
 *  sync_res_id: ID of the successfully allocated synchronization resource. It is used to reference the resource (such as event synchronization and inter-stream dependency) in subsequent execution processes.
 */
struct SyncResInfo {
  SyncResType type;                  // Resource type (such as event or memory synchronization)
  ge::AscendString name;             // Resource name (or type name). If reuse_key is empty, it is used as the reuse key.
  ge::AscendString reuse_key;        // Resource reuse key (Resources with the same key will be reused.)
  bool required{true};               // Whether the resource is mandatory
  bool is_valid{false};              // Resource allocation validity status
  int32_t sync_res_id{-1};           // ID of the successfully allocated synchronization resource. It is used for reference in the execution process.
};