Skip to content

Commit

Permalink
ctests for C top level embedded radar_tx and radae_rx
Browse files Browse the repository at this point in the history
  • Loading branch information
drowe67 committed Sep 26, 2024
1 parent e72c679 commit b5d1fee
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run_ctest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
shell: bash
run: |
sudo apt update
sudo apt install octave octave-common octave-signal sox cmake git
sudo apt install octave octave-common octave-signal sox cmake git python3.10-dev
- name: Install python packages
shell: bash
Expand Down
29 changes: 24 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -404,21 +404,40 @@ add_test(NAME radae_rx_aux_mpp

# Embedding Python in C callable library ------------------------------------------------------------------------------------------------------

# basic test of Embedded version of streaming Tx, compare to vanilla Tx in inference.py
add_test(NAME radae_tx_embed
# Test Embedded version of streaming Tx, running with Python __main__
add_test(NAME radae_tx_embed_py
COMMAND sh -c "cd ${CMAKE_SOURCE_DIR}; \
./inference.sh model19_check3/checkpoints/checkpoint_epoch_100.pth wav/brian_g8sez.wav /dev/null \
--rate_Fs --pilots --pilot_eq --eq_ls --cp 0.004 --bottleneck 3 --auxdata --write_rx rx.f32 --correct_freq_offset; \
cd embed; cat ../features_in.f32 | python3 radae_tx.py > ../rx.f32; cd ..;
cat rx.f32 | python3 radae_rx.py model19_check3/checkpoints/checkpoint_epoch_100.pth -v 1 --auxdata > features_txs_out.f32; \
python3 loss.py features_in.f32 features_txs_out.f32 --loss_test 0.15 --acq_time_test 0.5")
set_tests_properties(radae_tx_embed PROPERTIES PASS_REGULAR_EXPRESSION "PASS")
set_tests_properties(radae_tx_embed_py PROPERTIES PASS_REGULAR_EXPRESSION "PASS")

add_test(NAME radae_rx_embed
# Test Embedded version of streaming Rx, running with Python __main__
add_test(NAME radae_rx_embed_py
COMMAND sh -c "cd ${CMAKE_SOURCE_DIR}; \
./inference.sh model19_check3/checkpoints/checkpoint_epoch_100.pth wav/brian_g8sez.wav /dev/null \
--rate_Fs --pilots --pilot_eq --eq_ls --cp 0.004 --bottleneck 3 --auxdata --write_rx rx.f32 --correct_freq_offset; \
cd embed; cat ../rx.f32 | PYTHONPATH='../' python3 radae_rx.py > ../features_out.f32; cd ..;
python3 loss.py features_in.f32 features_out.f32 --loss_test 0.15 --acq_time_test 0.5")
set_tests_properties(radae_rx_embed PROPERTIES PASS_REGULAR_EXPRESSION "PASS")
set_tests_properties(radae_rx_embed_py PROPERTIES PASS_REGULAR_EXPRESSION "PASS")

# Test Embedded version of streaming Tx, running with C main()
add_test(NAME radae_tx_embed_c
COMMAND sh -c "cd ${CMAKE_SOURCE_DIR}; \
./inference.sh model19_check3/checkpoints/checkpoint_epoch_100.pth wav/brian_g8sez.wav /dev/null \
--rate_Fs --pilots --pilot_eq --eq_ls --cp 0.004 --bottleneck 3 --auxdata --write_rx rx.f32 --correct_freq_offset; \
cd embed; cat ../features_in.f32 | PYTHONPATH='.' ${CMAKE_CURRENT_BINARY_DIR}/src/radae_tx > ../rx.f32; cd ..;
cat rx.f32 | python3 radae_rx.py model19_check3/checkpoints/checkpoint_epoch_100.pth -v 1 --auxdata > features_txs_out.f32; \
python3 loss.py features_in.f32 features_txs_out.f32 --loss_test 0.15 --acq_time_test 0.5")
set_tests_properties(radae_tx_embed_c PROPERTIES PASS_REGULAR_EXPRESSION "PASS")

# Test Embedded version of streaming Rx, running with C main()
add_test(NAME radae_rx_embed_c
COMMAND sh -c "cd ${CMAKE_SOURCE_DIR}; \
./inference.sh model19_check3/checkpoints/checkpoint_epoch_100.pth wav/brian_g8sez.wav /dev/null \
--rate_Fs --pilots --pilot_eq --eq_ls --cp 0.004 --bottleneck 3 --auxdata --write_rx rx.f32 --correct_freq_offset; \
cd embed; cat ../rx.f32 | PYTHONPATH='.:../' ${CMAKE_CURRENT_BINARY_DIR}/src/radae_rx > ../features_out.f32; cd ..;
python3 loss.py features_in.f32 features_out.f32 --loss_test 0.15 --acq_time_test 0.5")
set_tests_properties(radae_rx_embed_c PROPERTIES PASS_REGULAR_EXPRESSION "PASS")

0 comments on commit b5d1fee

Please sign in to comment.