aboutsummaryrefslogtreecommitdiff
path: root/test/miscellaneous/odp_api_headers.c
blob: 0dd6b0a2e2208e4baa5cbd490ae116c1446956b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* Copyright (c) 2022, Nokia
 *
 * All rights reserved.
 *
 * SPDX-License-Identifier:     BSD-3-Clause
 */

#include <odp_api.h>
#include <odp/helper/odph_api.h>

int main(int argc ODP_UNUSED, char *argv[] ODP_UNUSED)
{
	odp_instance_t inst;

	if (odp_init_global(&inst, NULL, NULL)) {
		ODPH_ERR("Global init failed.\n");
		return -1;
	}

	if (odp_init_local(inst, ODP_THREAD_CONTROL)) {
		ODPH_ERR("Local init failed.\n");
		return -1;
	}

	odp_sys_info_print();
	printf("Helper library version: %s\n", odph_version_str());

	if (odp_term_local()) {
		ODPH_ERR("Local term failed.\n");
		return -1;
	}

	if (odp_term_global(inst)) {
		ODPH_ERR("Global term failed.\n");
		return -1;
	}

	return 0;
}