• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #undef NDEBUG
2 
3 #include <stdint.h>
4 #include <assert.h>
5 
6 #include "gen_device_info.h"
7 
8 int
main(int argc,char * argv[])9 main(int argc, char *argv[])
10 {
11    struct {
12       uint32_t pci_id;
13       const char *name;
14    } chipsets[] = {
15 #undef CHIPSET
16 #define CHIPSET(id, family, family_str, str_name) { .pci_id = id, .name = str_name, },
17 #include "pci_ids/i965_pci_ids.h"
18 #include "pci_ids/iris_pci_ids.h"
19    };
20 
21    for (uint32_t i = 0; i < ARRAY_SIZE(chipsets); i++) {
22       struct gen_device_info devinfo = { 0, };
23 
24       assert(gen_get_device_info_from_pci_id(chipsets[i].pci_id, &devinfo));
25 
26       assert(devinfo.gen != 0);
27       assert(devinfo.num_eu_per_subslice != 0);
28       assert(devinfo.num_thread_per_eu != 0);
29       assert(devinfo.timestamp_frequency != 0);
30    }
31 
32    return 0;
33 }
34