From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Llorens Newsgroups: gmane.lisp.guile.user Subject: [ANN] guile-ffi-cblas Date: Mon, 20 Oct 2014 07:46:17 +0200 Message-ID: <800015A5-88E2-415C-8B7B-6E7BB26064BC@bluewin.ch> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1413784010 21233 80.91.229.3 (20 Oct 2014 05:46:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 20 Oct 2014 05:46:50 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Oct 20 07:46:45 2014 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Xg5nn-0000RZ-Cu for guile-user@m.gmane.org; Mon, 20 Oct 2014 07:46:43 +0200 Original-Received: from localhost ([::1]:42572 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xg5nn-0008Is-27 for guile-user@m.gmane.org; Mon, 20 Oct 2014 01:46:43 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xg5nZ-0008H2-H2 for guile-user@gnu.org; Mon, 20 Oct 2014 01:46:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xg5nT-0004ed-Mf for guile-user@gnu.org; Mon, 20 Oct 2014 01:46:29 -0400 Original-Received: from zhbdzmsp-smta17.bluewin.ch ([195.186.99.133]:43709) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xg5nT-0004eQ-GN for guile-user@gnu.org; Mon, 20 Oct 2014 01:46:23 -0400 Original-Received: from [195.186.227.130] ([195.186.227.130:62869] helo=zhhdzmsp-smta12.bluewin.ch) by zhbdzmsp-smta17.bluewin.ch (envelope-from ) (ecelerity 3.5.7.40067 r(Platform:3.5.7.0)) with ESMTP id A9/24-26555-CA1A4445; Mon, 20 Oct 2014 05:46:20 +0000 Original-Received: from [10.0.1.14] (178.196.121.127) by zhhdzmsp-smta12.bluewin.ch (8.5.142) (authenticated as dll@bluewin.ch) id 52A87E3C13B0A699 for guile-user@gnu.org; Mon, 20 Oct 2014 05:46:20 +0000 X-Mailer: Apple Mail (2.1878.6) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.186.99.133 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:11582 Archived-At: Hello, this is to announce that I've started a BLAS (Basic Linear Algebra = Subprograms) wrapper for Guile using the FFI. The wrapper is actually = for CBLAS, not that there's much difference. https://gitorious.org/guile-ffi-cblas Currently the wrapper covers: dot, axpy, nrm2, scal, asum, iamax, ger, = gemv and gemm in all variants. There's a test suite that covers dot, = axpy and partially gemv. I'll be adding the rest of the functions as I = find the time. The wrappers use the Guile array facility. This means that you don't = need to give the size, inc and order arguments, because those are taken = from the array object. E.g. rather than doing (cblas_dgemv CblasRowMajor CblasNoTrans M N alpha A lda X incX beta Y = incY) you just do (dgemv! alpha A CblasNoTrans X beta Y) and instead of doing (cblas_dgemv CblasRowMajor CblasTrans M N alpha A lda X incX beta Y = incY) you can do either of (dgemv! alpha (transpose-array A 1 0) CblasNoTrans X beta Y) (dgemv! alpha A CblasTrans X beta Y) Here I've retained the TransA parameter because otherwise CblasConjTrans = can't be done for free. None of the wrappers do any copying or type conversion. This means that = you can't pass an untyped array to dgemv! (it must be of type 'f64, = likewise 'f32 for sgemv!, etc.) and also that some cases that BLAS = doesn't support will fail, e.g. if both strides of A in dgemv! differ = from 1. All arguments are checked, or should be. I've looked at the Chicken wrappers: = http://wiki.call-cc.org/eggref/4/blas. These take srfi4 vectors with = explicit size & inc arguments, so the calls look closer to the original = library. I haven't decided yet whether to add compatible exports. (ffi = cblas) does export the raw library calls, but those are of course very = dangerous to use. There's no doc yet. Comments & contributions are welcome. Regards Daniel