root / volk / lib / volk_rank_archs.c @ 23914465
History | View | Annotate | Download (343 Bytes)
| 1 | #include<volk_rank_archs.h> |
|---|---|
| 2 | #include<stdio.h> |
| 3 | |
| 4 | unsigned int volk_rank_archs(const int* arch_defs, unsigned int arch) { |
| 5 | int i = 2; |
| 6 | unsigned int best_val = 0; |
| 7 | for(; i < arch_defs[0] + 1; ++i) { |
| 8 | if((arch_defs[i]&(!arch)) == 0) { |
| 9 | best_val = (arch_defs[i] > arch_defs[best_val + 1]) ? i-1 : best_val; |
| 10 | } |
| 11 | } |
| 12 | return best_val;
|
| 13 | } |