octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Please build the JIT branch


From: Max Brister
Subject: Re: Please build the JIT branch
Date: Tue, 17 Jul 2012 09:54:33 -0500

On Fri, Jul 13, 2012 at 3:12 AM, Michael Goffioul
<address@hidden> wrote:
> Results on Atom N270 500MB RAM, compiled with VS2010 (with debug enabled):
>
> n = 1e6
> K = 500
>
> with JIT:
>   vectorized = 24.31s
>   loopy = 0.203s (impressive, compared to the result without JIT...)
>
> without JIT:
>   vectorized = 23.8s
>   loopy = 130s
>
> I also tried the complex test:
>
> a = b = 1+1i;
> for ii=1:5
>   a = a + b;
> endfor
>
> unfortunately it generates a segmentation fault (works fine without JIT). If
> the goal is to enforce calling convention, then I suggest you use the
> appropriate modifiers instead of extern "C". If you want I can give it a
> quick try here.
>
> To compile successfully with MSVC, I had to apply the attached patch. The
> reason is to avoid duplicate symbols with liboctave when linking
> liboctinterp. MSVC is a bit pesky when it comes to instantiating template
> classes containing non-inlined methods and exporting the symbols in a DLL.
> In this specific case, problems occurred when compiling Array-jit.cc; I had
> to:
> 1) avoid a dll-exportable Array<octave_value> to be included, like in
> Cell.h, otherwise MSVC will try to instantiate *all* Array methods,
> including those in Array.cc, but those cannot be instantiated properly with
> octave_value as template parameter
> 2) mark Array<int> as dll-imported, to avoid MSVC to re-instantiate the
> methods in Array.cc for T=int; if it does, these symbols will clash with
> those exported from liboctave
>
> I think the patch is harmless and non-intrusive for other compilers, so I
> think it could be applied directly in your branch.

I applied the patch with the minor change of using extern for the
forward declaration of Array<octave_idx_type> in Array-jit.cc (this
was required in order to compile with gcc).

Max Brister


reply via email to

[Prev in Thread] Current Thread [Next in Thread]