<div class="gmail_quote">On Wed, Feb 8, 2012 at 6:05 PM, Raymond Toy <span dir="ltr"><<a href="mailto:toy.raymond@gmail.com">toy.raymond@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote"><div class="im">On Wed, Feb 8, 2012 at 6:01 AM, Juan Jose Garcia-Ripoll <span dir="ltr"><<a href="mailto:juanjose.garciaripoll@googlemail.com" target="_blank">juanjose.garciaripoll@googlemail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div>On Wed, Feb 8, 2012 at 6:59 AM, Raymond Toy <span dir="ltr"><<a href="mailto:toy.raymond@gmail.com" target="_blank">toy.raymond@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Does ecl have the equivalent of cmucl's (and sbcl's)<br>
with-float-traps-masked</blockquote><div><br></div></div><div>Not yet. This can be implemented using SI::TRAP-FPE</div><div><br></div><div><div>(defmacro with-float-traps-masked (&body body)</div><div> `(let ((%trap-bits (si::trap-fpe 'cl:last t)))</div>
<div> (unwind-protect</div><div> (progn (si::trap-fpe %trap-bits nil) ,@body)</div><div> (si::trap-fpe %trap-bits t))))</div></div></div></blockquote></div><div><br>This will probably work. I take it that this will disable all traps? This would be the typical expected Fortran mode, so that's perfect. <br>
</div></div></blockquote><div><br></div><div>'LAST tells ECL to return the last set of active traps and then the second statement deactivates them all.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote"><div>
</div><div class="im"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
and vector-sap?<br></blockquote><div><br></div><div>Hmm, is this for the CFFI? Because it is going to depend very much on what VECTOR-SAP has to return. For UFFI you have SI::MAKE-FOREIGN-DATA-FROM-ARRAY which takes an array and returns an UFFI pointer. Alternatively, C-INLINE may be easily used to retrieve the pointer in a C format.</div>
</div></blockquote></div><div><br>Thanks for the tips. I'm not very familiar with cffi or uffi. Basically, vector-sap needs to return something that can be made into a pointer for a foreign function to use as the address of an array/vector.<br>
</div></div></blockquote><div><br></div><div>I do not know how MATLISP invokes BLAS or equivalent functions. If you need a pointer, then you need to know in which format MATLISP needs it.</div><div><br></div><div>I had a look at MATLISP. It is probably not unconceivable to translate it all to ECL's FFI constructs. Seems that all the fortran interface is in one file (ffi-*.lisp) and generates code automatically. Producing the associated C code would be easy and more efficient.</div>
<div><br></div><div>Juanjo</div></div><div><br></div>-- <br>Instituto de Física Fundamental, CSIC<br>c/ Serrano, 113b, Madrid 28006 (Spain) <br><a href="http://juanjose.garciaripoll.googlepages.com" target="_blank">http://juanjose.garciaripoll.googlepages.com</a><br>