| @@ -49,6 +49,7 @@ This path uses: | |||||
| Important: | Important: | ||||
| - `gpudemod_kernels.dll` must be present next to `sdrd.exe` or in `internal/demod/gpudemod/build/` | - `gpudemod_kernels.dll` must be present next to `sdrd.exe` or in `internal/demod/gpudemod/build/` | ||||
| - `build-sdrplay.ps1` prepares the runtime DLL placement and PATH setup for SDRplay + CUDA DLLs | - `build-sdrplay.ps1` prepares the runtime DLL placement and PATH setup for SDRplay + CUDA DLLs | ||||
| - GPU validation is disabled by default for performance; enable it with `SDR_GPU_VALIDATE=1` when debugging | |||||
| - older experimental Windows build scripts were removed to avoid confusion | - older experimental Windows build scripts were removed to avoid confusion | ||||
| ### Linux | ### Linux | ||||
| @@ -435,8 +435,21 @@ func (e *Engine) Demod(iq []complex64, offsetHz float64, bw float64, mode DemodT | |||||
| e.SetFIR(taps) | e.SetFIR(taps) | ||||
| } | } | ||||
| filtered, ok := e.tryCUDAFIR(shifted, len(taps)) | filtered, ok := e.tryCUDAFIR(shifted, len(taps)) | ||||
| e.lastFIRUsedGPU = ok && ValidateFIR(shifted, taps, filtered, 1e-3) | |||||
| if !e.lastFIRUsedGPU { | |||||
| if ok { | |||||
| if validationEnabled() { | |||||
| e.lastFIRUsedGPU = ValidateFIR(shifted, taps, filtered, 1e-3) | |||||
| if !e.lastFIRUsedGPU { | |||||
| ftaps := make([]float64, len(taps)) | |||||
| for i, v := range taps { | |||||
| ftaps[i] = float64(v) | |||||
| } | |||||
| filtered = dsp.ApplyFIR(shifted, ftaps) | |||||
| } | |||||
| } else { | |||||
| e.lastFIRUsedGPU = true | |||||
| } | |||||
| } | |||||
| if filtered == nil { | |||||
| ftaps := make([]float64, len(taps)) | ftaps := make([]float64, len(taps)) | ||||
| for i, v := range taps { | for i, v := range taps { | ||||
| ftaps[i] = float64(v) | ftaps[i] = float64(v) | ||||
| @@ -0,0 +1,9 @@ | |||||
| //go:build cufft | |||||
| package gpudemod | |||||
| import "os" | |||||
| func validationEnabled() bool { | |||||
| return os.Getenv("SDR_GPU_VALIDATE") == "1" | |||||
| } | |||||