You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used DSP optimization as well as compiler opt -O2 (thanks, that this is possible with S3)
Problem Description
That example includes some bugs!
I fixed them (producing a sum of squares) and checked for other input as well as repeated timings:
Results:
I (1422) main: Start Example.
I (1422) main: The sum of N squares from 1 to N=256 = 5625216.000000 (reference=5625216)
I (1432) main: Operation for N samples take 2639 cycles
I (1432) main: End Example.
I (1432) main: The sum of N squares from 1 to N=256 = 5625216.000000 (reference=5625216)
I (1442) main: Operation for N samples take 429 cycles
I (1452) main: End Example.
Then I increased N to get (only second reading):
1581 cycles for N=1024 , factor=3.68
3117 cycles for N=2048 , factor=7.39
6189 cycles for N=4096 , factor=14.43
Fine, it is scaling as expected.
Expected Behavior
Maybe you can decrease setup time for first call of that routine? I guess it will not pay because usually dotprod will be called repeatedly.
Actual Behavior
Steps to repropduce
just double the test in main
"It is not a fault its a feature" (:->
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
dsps_dotprod_f32 is slow on first call (examples/dotprod)
dsps_dotprod_f32 is slow on first call (examples/dotprod) (DSP-121)
Dec 12, 2023
the timing for the first call is high because the dsps_dotprod_f32 is located in flash and should be copied to the cash after the first call. At second call it's already in cash, and the system don't spend time to copy it.
Environment
Problem Description
That example includes some bugs!
I fixed them (producing a sum of squares) and checked for other input as well as repeated timings:
Results:
I (1422) main: Start Example.
I (1422) main: The sum of N squares from 1 to N=256 = 5625216.000000 (reference=5625216)
I (1432) main: Operation for N samples take 2639 cycles
I (1432) main: End Example.
I (1432) main: The sum of N squares from 1 to N=256 = 5625216.000000 (reference=5625216)
I (1442) main: Operation for N samples take 429 cycles
I (1452) main: End Example.
Then I increased N to get (only second reading):
1581 cycles for N=1024 , factor=3.68
3117 cycles for N=2048 , factor=7.39
6189 cycles for N=4096 , factor=14.43
Fine, it is scaling as expected.
Expected Behavior
Maybe you can decrease setup time for first call of that routine? I guess it will not pay because usually dotprod will be called repeatedly.
Actual Behavior
Steps to repropduce
just double the test in main
"It is not a fault its a feature" (:->
The text was updated successfully, but these errors were encountered: