Open Deep Learning API
Loading...
Searching...
No Matches
odla_ops_control_flow.h
Go to the documentation of this file.
1//===- odla_ops_loop.h ----------------------------------------------------===//
2//
3// Copyright (C) 2019-2021 Alibaba Group Holding Limited.
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions and
15// limitations under the License.
16// =============================================================================
17
18#ifndef _ODLA_OPERATOR_OPS_LOOP_H_
19#define _ODLA_OPERATOR_OPS_LOOP_H_
20
21#include <ODLA/odla_common.h>
22#include <ODLA/odla_value.h>
23
28#ifdef __cplusplus
29extern "C" {
30#endif
31
33typedef enum {
35 ODLA_LOOP_FWD_BEFORE, /* !< Concatenated values for each iteration:
36 [init_value...last_value) */
37 ODLA_LOOP_FWD_AFTER, /* !< Concatenated values for each iteration:
38 [state_1...last_value]) */
39 ODLA_LOOP_REV_BEFORE, /* !< Concatenated values for each iteration,
40 in reverse order: (last_value...init_value]) */
41 ODLA_LOOP_REV_AFTER, /* !< Concatenated values for each iteration, in
42 reverse order: [last_value...init_value) */
44
47
53extern ODLA_API_EXPORT odla_value ODLA_API_CALL
55
58
65extern ODLA_API_EXPORT odla_status ODLA_API_CALL
67
70
82extern ODLA_API_EXPORT odla_values ODLA_API_CALL
83odla_EndLoop(odla_value condition, odla_values output_values,
85
86extern ODLA_API_EXPORT odla_status ODLA_API_CALL
87odla_BeginIf(odla_value condition, odla_value_id);
88
89extern ODLA_API_EXPORT odla_status odla_EnterBranchBody(odla_bool true_branch);
90
91extern ODLA_API_EXPORT odla_values ODLA_API_CALL odla_EndIf(odla_value_ids);
92
93#ifdef __cplusplus
94} // C extern
95#endif
96
97#endif // _ODLA_OPERATOR_OPS_LOOP_H_
#define ODLA_API_EXPORT
API export directives.
Definition: odla_common.h:172
odla_status
Return status.
Definition: odla_common.h:140
odla_uint32 odla_bool
Definition: odla_common.h:99
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_BeginLoop(odla_value trip_count, odla_value_id value_id)
Create a loop. All subsequent loop related APIs are specific to this one until the correspoding odla_...
odla_loop_output_mode
Types of loop output.
@ ODLA_LOOP_LAST_VALUE
ODLA_API_EXPORT odla_values ODLA_API_CALL odla_EndLoop(odla_value condition, odla_values output_values, const odla_loop_output_mode *flags, odla_value_ids)
ODLA_API_EXPORT odla_value ODLA_API_CALL odla_CreateLoopVariable(odla_value init_value, odla_value_id value_id)
Create a loop variable which has an initial value and recurrent values.
struct _odla_value_id * odla_value_id
Unique id of each value.
Definition: odla_value.h:74
struct _odla_value * odla_value
Value definition.
Definition: odla_value.h:65
Multiple value ids.
Definition: odla_value.h:77
Multiple values.
Definition: odla_value.h:68