[lisplab-cvs] r90 - src/core src/fft
Jørn Inge Vestgården
jivestgarden at common-lisp.net
Fri Aug 28 19:18:29 UTC 2009
Author: jivestgarden
Date: Fri Aug 28 15:18:28 2009
New Revision: 90
Log:
thread stuff
Added:
src/core/level0-thread.lisp
Modified:
lisplab.asd
src/core/level0-basic.lisp
src/fft/fftw-ffi.lisp
src/fft/level3-fft-fftw.lisp
Modified: lisplab.asd
==============================================================================
--- lisplab.asd (original)
+++ lisplab.asd Fri Aug 28 15:18:28 2009
@@ -49,6 +49,7 @@
(:file "level0-interface")
(:file "level0-functions")
(:file "level0-permutation")
+ (:file "level0-thread")
(:file "level0-infpre")))
;;
Modified: src/core/level0-basic.lisp
==============================================================================
--- src/core/level0-basic.lisp (original)
+++ src/core/level0-basic.lisp Fri Aug 28 15:18:28 2009
@@ -76,13 +76,3 @@
(make-array n :element-type 'double-float :initial-element 0.0))
-;;; THREADS stuff. TODO: move away from here
-
-(defvar *lisplab-num-threads* 0)
-
-(defmethod init-threads (num-threads)
- (cleanup-threads)
- (setf *lisplab-num-threads* num-threads))
-
-(defmethod cleanup-threads ())
-
Added: src/core/level0-thread.lisp
==============================================================================
--- (empty file)
+++ src/core/level0-thread.lisp Fri Aug 28 15:18:28 2009
@@ -0,0 +1,29 @@
+;;; Lisplab, level0-thread.lisp
+;;; Threads code. So far only for SBCL.
+
+;;; Copyright (C) 2009 Joern Inge Vestgaarden
+;;;
+;;; This program is free software; you can redistribute it and/or modify
+;;; it under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 2 of the License, or
+;;; (at your option) any later version.
+;;;
+;;; This program is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License along
+;;; with this program; if not, write to the Free Software Foundation, Inc.,
+;;; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+
+(in-package :lisplab)
+
+(defvar *lisplab-num-threads* 1)
+
+(defmethod init-threads (num-threads)
+ (cleanup-threads)
+ (setf *lisplab-num-threads* num-threads))
+
+(defmethod cleanup-threads ())
\ No newline at end of file
Modified: src/fft/fftw-ffi.lisp
==============================================================================
--- src/fft/fftw-ffi.lisp (original)
+++ src/fft/fftw-ffi.lisp Fri Aug 28 15:18:28 2009
@@ -77,7 +77,7 @@
(defun fftw-fft2 (m n in out direction flag)
"Two dimensional fft by forign call to fftw."
;; TODO we should handle conditions to avoid mem-leaks
- (with-pinned-objects (in out m n direction flag)
+ (with-pinned-objects (in out)
(let ((plan (|fftw_plan_dft_2d|
n ; swap n and m due to row major order
m
Modified: src/fft/level3-fft-fftw.lisp
==============================================================================
--- src/fft/level3-fft-fftw.lisp (original)
+++ src/fft/level3-fft-fftw.lisp Fri Aug 28 15:18:28 2009
@@ -39,7 +39,7 @@
(defun fftw-use-threads-p ()
(and cl-user::*lisplab-libfftw-threads-path*
- (> *lisplab-num-threads* 0)))
+ (> *lisplab-num-threads* 1)))
(defmethod init-threads :after (num-threads)
(when (fftw-use-threads-p)
More information about the lisplab-cvs
mailing list