Commit Graph

9 Commits

Author SHA1 Message Date
Max Podkorytov
aa2a5778e6 Apply clang-format to sequence helper tests 2026-01-20 11:20:03 -06:00
Max Podkorytov
af1f05efad Add 7D broadcast test with non-adjacent dimensions
Tests element space size calculation when two non-adjacent middle
dimensions (dims 2 and 4) have stride 0 (broadcast).
2026-01-20 11:14:38 -06:00
Max Podkorytov
e1f2d45ef4 Add 8D tensor descriptor tests
Test high-dimensional tensors to verify no integer overflow in
element space size calculations. Includes:
- 8D packed test with prime dimensions (180180 elements)
- 8D permuted layout test with non-monotonous strides
  (memory order differs from logical order)
2026-01-20 10:43:49 -06:00
Max Podkorytov
1a5d956be7 Use unique prime values in container helper tests
- Replace repeated 1,2,3,4 values with unique primes
- Each test now uses distinct input values
2026-01-20 10:37:36 -06:00
Max Podkorytov
1be9e524ce Use unique input values in sequence helper tests
- Vary sequence values across all tests to avoid repetition
- Use prime numbers for distinct, coprime test data
- Add TwoSequences test for unpack_and_merge_sequences
2026-01-20 10:36:10 -06:00
Max Podkorytov
97873bc0d5 Expand tensor descriptor test coverage
- Add tests for make_naive_tensor_descriptor_packed (1D, 2D, 3D)
- Add tests for make_naive_tensor_descriptor_aligned (2D, 3D)
- Add 1D tensor tests with explicit strides
- Ensure all shapes use distinct, coprime dimensions
2026-01-19 23:41:39 -06:00
Max Podkorytov
b60d14ba89 Address review feedback on tensor descriptor helper tests
- Remove tests of implementation details (detail::compute_element_space_size)
- Use public API (make_naive_tensor_descriptor) for all tests
- Avoid square/cube shapes that could hide row/column major bugs
- Use prime numbers for padding tests to catch index calculation errors
- Add two padding test cases: arbitrary offsets and stride slice
2026-01-19 23:31:13 -06:00
Max Podkorytov
0c8188374a Add unit tests for template optimization helpers
Add Google Tests for optimized template utilities:
- sequence_gen: Tests with custom functors (4 tests)
- generate_identity_sequences: Tuple of identity sequences (4 tests)
- find_in_tuple_of_sequences: O(1) sequence search (6 tests)
- sequence_find_value: Value lookup in sequences (5 tests)
- container_concat: Tuple/array concatenation (5 tests)
- make_uniform_tuple: Repeated value tuples (4 tests)
- compute_element_space_size: Fold expression (8 tests)
- unpack_and_merge_sequences: Sequence merging (2 tests)

Total: 43 new tests across 4 test files.
2026-01-19 18:35:57 -06:00
John Shumway
15ed65db35 Improve sequence sorting and add unit tests (#3376)
Old sequence sort code was showing up on build profiles. Convert it to constexpr functions for much more efficient build-time execution. The sorting is still O(N^2), but our sequences are small enough it executes quickly. This reduced compilation time of a small convolution by more than 10% and time overall time spent in the compiler on a narrow build by %6.
2025-12-10 12:25:23 -08:00