| 1831 | return false; |
| 1832 | } |
| 1833 | const size_t nr = fread(data, sizeof(float), (size_t)n, fp); |
| 1834 | const bool ok = nr == (size_t)n && fclose(fp) == 0; |
| 1835 | if (!ok) { |
| 1836 | fprintf(stderr, "ds4: failed to read %s\n", path); |
| 1837 | return false; |
| 1838 | } |
| 1839 | return true; |
| 1840 | } |
| 1841 | |
| 1842 | static bool cpu_directional_steering_enabled( |
| 1843 | const float *dirs, |
| 1844 | float scale); |
| 1845 | |
| 1846 | static void cpu_directional_steering_project_rows( |
| 1847 | float *x, |
| 1848 | const float *dirs, |
| 1849 | uint32_t il, |
| 1850 | uint32_t rows, |
| 1851 | float scale); |
| 1852 | |
| 1853 | typedef void (*ds4_parallel_fn)(void *ctx, uint64_t row0, uint64_t row1); |
| 1854 | |
| 1855 | #define DS4_MAX_THREADS 32 |
| 1856 | |
| 1857 | typedef struct { |
| 1858 | pthread_t threads[DS4_MAX_THREADS]; |