Raul wrote:
>This isn't really worth a pull request, but double->float is 1&(3!:5)
>and float->double is _1&(3!:5)

>This is documented at
>http://www.jsoftware.com/help/dictionary/dx003.htm <http://www.jsoftware.com/help/dictionary/dx003.htm>. (Note that floats
>are represented as a sequence of literals, because J can't work with
>them.)

Thanks Raul: I've used 3!:5/fc at some point in my brief J career to accomplish this (I think in the flann hooks).

For my education: when I do a=. 1&(3!:5)b, this does a deep copy, right? Aka, there isn't some weird bit masking thing, with a and b referring to the same memory location, is there? I confess, I never quite understood what the C compiler does when you do something like a = (float *) &b; -I always figured it was passing to a by reference somehow.

Speaking of deep copy, the only tricky part of this is going to be pushing the data to the GPU and pulling it back out again. If I can return some kind of useful pointers to the GPU data, the way it is done in Torch7, it should work pretty well.

I'm quite pleased with the blas-mp speedup; it's already useful.

-SL

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to