SqueezeBrains SDK 1.13
init_library.c
Go to the documentation of this file.
1
14#include <stdio.h>
15#include "../lib/sb.h"
16#include "../common/common.h"
17
21int main(void)
22{
24 sb_t_info* sb_info = NULL;
25
27 printf("Initialize the SqueezeBrains library\n");
28 CHECK_FN_GOTO(sb_init("../sb.lic"))
29
30
31 CHECK_FN_GOTO(sb_get_info(&sb_info, 0))
32 printf("sb ver. %s, compiled on %s %s\n", sb_info->version_str, sb_info->compile_date, sb_info->compile_time);
33
35 printf("wait for license...\n");
37
38 // Now the SqueezeBrains Library is initialized and it is possible to use any function of the library
39
40FnExit:
41 sb_destroy_info(&sb_info);
42
44 printf("Release SqueezeBrains library\n");
45 sb_release();
46
47 printf("Press ENTER to terminate\n");
48 getchar();
49 return (int)err;
50}
EXTERN_C sb_t_err wait_license(void)
The functions wait until the license status is active.
Definition: common.c:11
#define CHECK_FN_GOTO(function)
Definition: common.h:34
sb_t_err
Errors code enum.
Definition: sb.h:5541
@ SB_ERR_NONE
No errors.
Definition: sb.h:5542
sb_t_err sb_destroy_info(sb_t_info **const info)
Destroys the structure.
sb_t_err sb_release(void)
Releases all the resources allocates in the library.
sb_t_err sb_init(const char *const license_file)
Initializes the SB library.
sb_t_err sb_get_info(sb_t_info **const info, int gpu_info)
The function gets information about the sb library and the available computational devices.
int main(void)
Definition: init_library.c:21
General information about sb library and computing devices like CPU and GPUs.
Definition: sb.h:6180
char compile_time[32]
String with the compilation time of the sb library.
Definition: sb.h:6184
char compile_date[32]
String with the compilation date of the sb library.
Definition: sb.h:6183
char version_str[16]
String with the version of the sb library.
Definition: sb.h:6182