Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: b0523a1fff
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (25 sloc) 0.962 kb
(defpackage #:pfft
(:use :cl)
(:export #:pfft #:pifft)
(:import-from :fft :perform-fft :virtual-row :next-row :make-dst-buf))
(in-package #:pfft)
(defun perform-parallel-rows (row inverse &optional task-list)
(when row
(let* ((task (pcall:pexec (perform-fft row inverse)))
(task-list (cons task task-list)))
(multiple-value-bind (next-row advanced) (next-row row)
(cond
((or advanced (null next-row))
(mapc #'pcall:join task-list)
(perform-parallel-rows next-row inverse))
(t (perform-parallel-rows next-row inverse task-list)))))))
(defun pfft (src &optional dst)
#-thread-support (fft:fft src dst)
#+thread-support (let ((dst (make-dst-buf src dst)))
(perform-parallel-rows (virtual-row dst) nil)
dst))
(defun pifft (src &optional dst)
#-thread-support (fft:ifft src dst)
#+thread-support (let ((dst (make-dst-buf src dst)))
(perform-parallel-rows (virtual-row dst) t)
dst))
Jump to Line
Something went wrong with that request. Please try again.