Open Deep Learning API
Loading...
Searching...
No Matches
odla_task.h
Go to the documentation of this file.
1//===- odla_task.h --------------------------------------------------------===//
2//
3// Copyright (C) 2019-2020 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_TASK_H_
19#define _ODLA_TASK_H_
20
21#include <ODLA/odla_common.h>
22#include <ODLA/odla_device.h>
23#include <ODLA/odla_value.h>
24
29#ifdef __cplusplus
30extern "C" {
31#endif
32
34typedef struct {
35 void (*func)(odla_device, odla_values inputs, odla_values outputs);
36 odla_values inputs;
37 odla_values outputs;
38} odla_task;
39
42 odla_task),
44
47
49
54extern ODLA_API_EXPORT odla_status ODLA_API_CALL
56
58
63extern ODLA_API_EXPORT odla_status ODLA_API_CALL
65
66#ifdef __cplusplus
67} // C extern
68#endif
69
70#endif // _ODLA_COMMON_H_
#define ODLA_API_EXPORT
API export directives.
Definition: odla_common.h:172
odla_status
Return status.
Definition: odla_common.h:140
struct _odla_device * odla_device
Device object.
Definition: odla_device.h:98
odla_status odla_SetAsyncExecutor(odla_async_executor executor)
\biref set a customized async executor
odla_status(* odla_async_executor)(odla_status(*)(odla_device, odla_task), odla_device, odla_task)
odla task async executor
Definition: odla_task.h:41
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_RunTask(odla_device device, odla_task task)
Start a ODLA task in a synchronized manner.
ODLA_API_EXPORT odla_status ODLA_API_CALL odla_RunTaskAsync(odla_device device, odla_task task)
Start a ODLA task in a asynchronized manner.
odla task definition
Definition: odla_task.h:34
Multiple values.
Definition: odla_value.h:68