SqueezeBrains SDK 1.18
master_license_request.c
Go to the documentation of this file.
1
15#include "../common/common.h"
16
20int main(void)
21{
23 sb_t_info* sb_info = NULL;
24
29 printf("Initialize the SqueezeBrains library\n");
31
32 // Print library version.
33 CHECK_FN_GOTO(sb_get_info(&sb_info, 0))
34 printf("sb ver. %s, compiled on %s %s\n", sb_info->version_str, sb_info->compile_date, sb_info->compile_time);
35
37 char* hw_info = NULL;
39 if (hw_info == NULL)
40 {
41 printf("ERROR: impossibile to get hardware information\n");
42 goto FnExit;
43 }
44 FILE* f = NULL;
45 f = fopen("../hw.lic", "w");
46 fwrite(hw_info, 1, strlen(hw_info), f);
47 fclose(f);
48 sb_free(hw_info);
49 printf("\nHardware information have been saved in the file \"hw.lic\"\n");
50 printf("To buy a master license send this file to licensing@fabervision.com\n\n");
51
52
53FnExit:
54 sb_destroy_info(&sb_info);
55
57 printf("Release SqueezeBrains library\n");
58 sb_release();
59
60 printf("Press ENTER to terminate\n");
61 getchar();
62 return (int)err;
63}
#define CHECK_FN_GOTO(function)
Definition: common.h:34
sb_t_err
Errors code enum.
Definition: sb.h:6230
@ SB_ERR_NONE
No errors.
Definition: sb.h:6231
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_get_info(sb_t_info **const info, int dl_devices_info)
The function gets information about the sb library and the available computational devices.
sb_t_err sb_init(const char *const license_file)
Initializes the SB library.
#define SB_INIT_NO_LICENSE_KEY
Use this define with sb_init in order to not manage license keys.
Definition: sb.h:6678
sb_t_err sb_license_get_hw_info(char **const str)
Returns the hardware information.
void sb_free(void *ptr)
Deallocates a memory block.
int main(void)
General information about sb library and computing devices like CPU and GPUs.
Definition: sb.h:6946
char compile_time[32]
String with the compilation time of the sb library.
Definition: sb.h:6950
char compile_date[32]
String with the compilation date of the sb library.
Definition: sb.h:6949
char version_str[16]
String with the version of the sb library.
Definition: sb.h:6948