[GSLL-devel] [Gsll-devel] Efficient access to externally generated double-float arrays?
Liam Healy
lhealy at common-lisp.net
Sun Nov 14 16:58:54 UTC 2010
On Sun, Nov 14, 2010 at 10:24 AM, Sebastian Sturm
<Sebastian.Sturm at itp.uni-leipzig.de> wrote:
> My apologies for taking so long to answer. I have verified that the new gref* can now be used without consing and comes relatively close to the unconvenient cffi:mem-aref solution in terms of computation time. Many thanks for that! I also tried the functions on matrices, which still results in some consing, but this doesn't seem to be time-critical here. In my experiments, most of the consing could be eliminated by storing the linearized index in an auxiliary variable, but this even resulted in a slight runtime increase.
> For my original application, the GSLL solution is now comparable in speed to Mathematica for small dimensionality (dim < about 50); for a fair comparison of both solutions for larger dim, I'll have to rework my very naive computation of the Hessian matrix.
>
> Judging from the git commits, you have also changed something related to complex-valued arrays. Did you implement similar optimizations as in the real-valued case? I'll try that once I have repaired my Hessian.
>
> Best regards,
> Sebastian
The work is still ongoing. I don't know when you last pulled, but
I've made a few commits in the last day or so, and I'm working on some
more improvements. My previous email was incorrect in stating that
the 'declare form doesn't work; it does at least in newer versions of
SBCL. Also, I've expanded use to CCL because that supports
variable-information as well (this hasn't been committed yet). The
other recent change is that inputs and outputs of gref* and (setf
gref*) are now wrapped with the appropriate 'the forms to help the
compiler optimize. So far these mostly apply only to vectors (1
dimensional arrays) but I am working on compile-time linearization of
indices for higher dimensional arrays, so that at compile time the
forms will also expand directly into mem-aref calls; that should help
with your matrices if they are declared with their dimensions. I'm
working on this now. Everything should apply to all foreign array
types, including complex.
Liam
More information about the gsll-devel
mailing list