Browse Source

refactor: reuse shifted IQ from CUDA path

master
Jan Svabenik 3 days ago
parent
commit
a64b776fc3
2 changed files with 15 additions and 3 deletions
  1. +11
    -0
      internal/demod/gpudemod/doc.go
  2. +4
    -3
      internal/demod/gpudemod/gpudemod.go

+ 11
- 0
internal/demod/gpudemod/doc.go View File

@@ -0,0 +1,11 @@
// Package gpudemod contains the CUDA-tagged demodulation pipeline scaffolding.
//
// Current state:
// - Standard builds use the !cufft stub.
// - cufft builds allocate GPU buffers and cross the CGO/CUDA launch boundary.
// - If/when a CUDA freq-shift launch succeeds, the shifted IQ is copied back and
// reused by the remaining CPU-side FIR/decimate/NFM pipeline.
//
// This keeps Phase 1 incremental and verifiable while later phases replace the
// placeholder launch wrappers with real kernels.
package gpudemod

+ 4
- 3
internal/demod/gpudemod/gpudemod.go View File

@@ -175,9 +175,10 @@ func (e *Engine) Demod(iq []complex64, offsetHz float64, bw float64, mode DemodT
// Real CUDA boundary is now present. If the launch wrappers are not yet backed
// by actual kernels, we fall back to the existing CPU DSP path below.
_ = fmt.Sprintf("%s:%0.3f", phaseStatus(), offsetHz)
_ = e.tryCUDAFreqShift(iq, offsetHz)

shifted := dsp.FreqShift(iq, e.sampleRate, offsetHz)
shifted, ok := e.tryCUDAFreqShift(iq, offsetHz)
if !ok {
shifted = dsp.FreqShift(iq, e.sampleRate, offsetHz)
}
cutoff := bw / 2
if cutoff < 200 {
cutoff = 200


Loading…
Cancel
Save