Re: [Jprogramming] arrayfire addon updated

2022-02-28 Thread greg heil
f16 in AVX? ~greg heil picsrp.github.io i.tgu.ca/real_cal -- from: Eric Iverson date: Feb 28, 2022, 10:36 AM subject: [Jprogramming] arrayfire addon updated arrayfire addon updated with minor fixes >Main change is matmul now has wrappers for best performance for either f64 or >f32 (

[Jprogramming] arrayfire addon updated

2022-02-28 Thread Eric Iverson
arrayfire addon updated with minor fixes Main change is matmul now has wrappersfor best performance for either f64 or f32 (avoids expensive conversion of row major to column major with square matrices by using matmul transpose flag). Get started: load '~addons/math/arrayfire/arrayfire.ijs'

[Jprogramming] arrayfire addon updated

2022-02-23 Thread Eric Iverson
arrayfire addon updated The addon allows high performance computing of matrix product and many other mathematical array operations. Multiple cpu cores and hardware such as Nvidia gpus are used as appropriate. Browse https://arrayfire.org for more info. There are many small improvements and a

Re: [Jprogramming] ArrayFire addon

2022-01-30 Thread 'Mike Day' via Programming
Sorry, iPad spell-checker rendered “mptime” as “motive”! M Sent from my iPad > On 30 Jan 2022, at 10:49, 'Mike Day' via Programming > wrote: > > One glitch: > man_jaf_ ‘benchmarks’ > ... > motive 4000NB. takes sev seconds > ... > > mptime 4000 > |domain error: mptime > >

Re: [Jprogramming] ArrayFire addon

2022-01-30 Thread 'Mike Day' via Programming
One glitch: man_jaf_ ‘benchmarks’ ... motive 4000NB. takes sev seconds ... mptime 4000 |domain error: mptime mptime turns out to be dyadic Mike Sent from my iPad > On 28 Jan 2022, at 21:51, Eric Iverson wrote: > > Mike, > FIxed. Update and please try again. > > On Fri, Jan

Re: [Jprogramming] ArrayFire addon

2022-01-29 Thread 'Mike Day' via Programming
Not a problem, just hoping for some enlightenment. As Raul found, init_jaf_ worked with both ‘cpu’ and ‘opencl’ but not ‘cuda’. The last didn’t surprise me, as I hadn’t downloaded cuda. However, while ... freeall ‘’ after init ‘cpu’ (dropping the _jaf_) reported, verbosely, ... [0] AMD:

Re: [Jprogramming] ArrayFire addon

2022-01-28 Thread Raul Miller
On Fri, Jan 28, 2022 at 6:52 PM Eric Iverson wrote: > Meanwhile, are you able to run the tutorials etc with the cpu backend? I have not worked through all of the tutorials, yet. But those that I have tried have worked. That said, I was using the opencl backend, rather than the cpu backend.

Re: [Jprogramming] ArrayFire addon

2022-01-28 Thread Raul Miller
For example, perhaps the first time math/arrayfire is loaded, it could do init_jaf_'cpu' and if that fails, it could report that the supporting arrayfire library is not installed. But if that succeeds, later messages could suggest other possibilities. Thanks, -- Raul On Fri, Jan 28, 2022 at

Re: [Jprogramming] ArrayFire addon

2022-01-28 Thread Eric Iverson
Raul, Good point. Init tries to load the library and if that fails it gives the af not installed error. But trying to load the cuda library will fail if cuda is not installed. So the error message is misleading. I will fix this, ' Meanwhile, are you able to run the tutorials etc with the cpu

Re: [Jprogramming] ArrayFire addon

2022-01-28 Thread Raul Miller
On Fri, Jan 28, 2022 at 6:15 PM 'Pascal Jasmin' via Programming wrote: > If you only have the error on 'cuda', its bc you don't have nvidia gpu. I understand that. But I feel that the error should not say that arrayfire is not installed when arrayfire is, in fact, installed. Thanks, -- Raul

Re: [Jprogramming] ArrayFire addon

2022-01-28 Thread 'Pascal Jasmin' via Programming
If you only have the error on 'cuda', its bc you don't have nvidia gpu. On Friday, January 28, 2022, 06:09:05 p.m. EST, Raul Miller wrote:   init_jaf_'cpu'   init_jaf_'opencl'   init_jaf_'cuda' ArrayFire not installed or not installed where init is looking   man_jaf_'install

Re: [Jprogramming] ArrayFire addon

2022-01-28 Thread Raul Miller
init_jaf_'cpu' init_jaf_'opencl' init_jaf_'cuda' ArrayFire not installed or not installed where init is looking man_jaf_'install arrayfire' NB. for more info |assertion failure: assert | ('load library failed: ',t)assert 0[echo afmissing I think my problem here is different

Re: [Jprogramming] ArrayFire addon

2022-01-28 Thread 'Mike Day' via Programming
Thanks. Vn 2.1.7 loads ok. Sorry about the typos on my part: JAPP for JAFP, etc I was copy-typing from laptop onto this iPad which isn’t up to running J903. Mike Sent from my iPad > On 28 Jan 2022, at 21:51, Eric Iverson wrote: > > Mike, > FIxed. Update and please try again. > > On

Re: [Jprogramming] ArrayFire addon

2022-01-28 Thread Eric Iverson
Mike, FIxed. Update and please try again. On Fri, Jan 28, 2022 at 4:44 PM Eric Iverson wrote: > Sloppy release on my part. I will fix this in a few minutes. > > > On Fri, Jan 28, 2022 at 4:39 PM 'Mike Day' via Programming < > programm...@jsoftware.com> wrote: > >> I’ve just updated the addon to

Re: [Jprogramming] ArrayFire addon

2022-01-28 Thread Eric Iverson
Sloppy release on my part. I will fix this in a few minutes. On Fri, Jan 28, 2022 at 4:39 PM 'Mike Day' via Programming < programm...@jsoftware.com> wrote: > I’ve just updated the addon to Vn 2.1.6, and tried > >load ‘~addons/math/arrayfire/arrayfire.ijs’ > |value error: JAPP > | d=.toJ

Re: [Jprogramming] ArrayFire addon

2022-01-28 Thread 'Mike Day' via Programming
I’ve just updated the addon to Vn 2.1.6, and tried load ‘~addons/math/arrayfire/arrayfire.ijs’ |value error: JAPP | d=.toJ Freda. JAPP,’man.txt’ |[-56] c:\…\addons\…\arrayfire.ijs This is in the latest J version, j903/j64avx2/Windows Release-b...28T04:09:50 Library: 9.03.08 ... I ran

Re: [Jprogramming] Arrayfire addon

2022-01-28 Thread Eric Iverson
Thanks for the feedback. af_matmul just starts dthe op on the gpu (or other cpu theads) and returns almost immediately. af_sync waits until the op is done. This is clear if you play with them in the repl. Retail nvidia gpu support for 64bit float is slow. For example, on my GTX 1050 Ti matmul

Re: [Jprogramming] arrayfire addon updated

2022-01-28 Thread Eric Iverson
Yes, it might make sense to include the arrayfire lib in some way with the addon. Let's get a bit more experience with it as it stands and then decide. For example, the addon could offer the option of getting the lib from jsoftware.com. Note that arrayfire includes opencl lib in its lib so we

Re: [Jprogramming] arrayfire addon updated

2022-01-28 Thread bill lam
I checked the lib folder is about 1GB after zipped. The installer downloaded from arrayfire is about 7GB. On Fri, 28 Jan 2022 at 9:18 AM bill lam wrote: > I think af addon doesn't need include or lib files to run. If dll files > only are mandatory, can these windows dll be downloaded from j

Re: [Jprogramming] arrayfire addon updated

2022-01-27 Thread 'Pascal Jasmin' via Programming
thank you Eric, I see the point that making dyads would lose access to options.  Its a matter of opinion as to whether the options are useful enough to "need them".  My opinion is that they are not, and we/users who need to optimize calls with options could "easily" make a "linear cover

Re: [Jprogramming] arrayfire addon updated

2022-01-27 Thread 'Pascal Jasmin' via Programming
instructions in   man_jaf_ 'bench' mptime 600 gets faster results on    init_jaf_ 'cpu'  and    init_jaf_ 'cuda' on my system.  But that is full round trip to J execution. If you are keeping results on gpu for further processing, then its faster for all matrix sizes as arrayfire structures. 

[Jprogramming] Arrayfire addon

2022-01-27 Thread Mike Powell
This looks really interesting. My first look at this was mp_bench.ijs example. This produces (on my iMac): ┌┬┐ │ step │ millis │ ├┼┤ │mp │3260│ ├┼┤ │acreate │708 │ ├┼┤ │bcreate │474 │ ├┼┤ │matmul

Re: [Jprogramming] arrayfire addon updated

2022-01-27 Thread Ric Sherlock
Thanks Eric - this looks very promising! I managed to get it installed & running on WSL although I needed to amend the instructions on the arrayfire website somewhat so I could write to /etc/ld.so.conf.d/ Any thoughts on where the switchover point is at which Arrayfire is compelling relative to

Re: [Jprogramming] arrayfire addon updated

2022-01-27 Thread bill lam
I think af addon doesn't need include or lib files to run. If dll files only are mandatory, can these windows dll be downloaded from j software website and put into a folder under the af addon? On Fri, 28 Jan 2022 at 5:08 AM Eric Iverson wrote: > arrayfire addon updated > > * improved init > >

Re: [Jprogramming] arrayfire addon updated

2022-01-27 Thread 'Mike Day' via Programming
I did manage to install it eventually! Other Windows users might wish to know that I found I needed to load J as an administrator to avoid failure. Thanks, Mike Sent from my iPad > On 27 Jan 2022, at 21:07, Eric Iverson wrote: > > arrayfire addon updated > > * improved init > > * support

[Jprogramming] arrayfire addon updated

2022-01-27 Thread Eric Iverson
arrayfire addon updated * improved init * support for apple m1 * Pascal's idea that integer lists are better than boxed lists this required changes in several of the tutorial examples for example, q=. af_matmul_jaf_ af1;af2 was changed to q=. af_matmul_jaf_ af1,af2 * J like dyad

Re: [Jprogramming] ArrayFire addon

2022-01-27 Thread Eric Iverson
Bill's change will be pushed to addons later today. I will post when the new version is available. On Thu, Jan 27, 2022 at 1:11 PM Andreas Lagerås wrote: > Hi, > > May I ask how you updated it to work with the homebrew arrayfire, or will > that be fixed in a future version? > > Best regards, >

Re: [Jprogramming] ArrayFire addon

2022-01-27 Thread Andreas Lagerås
Hi, May I ask how you updated it to work with the homebrew arrayfire, or will that be fixed in a future version? Best regards, /Andreas Den tors 27 jan. 2022 kl 15:23 skrev bill lam : > I have made a minor update to the addon to allow use arrayfire installed > via homebrew. > > on apple m1 >

Re: [Jprogramming] ArrayFire addon

2022-01-27 Thread Eric Iverson
Jan-Pieter, Thanks for your feedback. Your fixes will be in the next version. I have not tested with opencl and will get to that shortly. I thought of this as primarily a way to use nvidia gpus. But the cpu support works well and so probably does opencl. Not sure where this leads. Probably not

Re: [Jprogramming] ArrayFire addon

2022-01-27 Thread Eric Iverson
Jan-Pieter, ArrayFire uses a modified CSR from the wikipedia documentation. Instead of just counts it has +/\ counts. It also has a leading 0 and a trailing value. On Thu, Jan 27, 2022 at 3:50 AM Jan-Pieter Jacobs < janpieter.jac...@gmail.com> wrote: > Thanks for the explanation Hauke. > I guess

Re: [Jprogramming] ArrayFire addon

2022-01-27 Thread bill lam
I have made a minor update to the addon to allow use arrayfire installed via homebrew. on apple m1 init_jaf_ 'cpu' and 'opencl' are available but 'opencl' doesn't support double precision > On 27 Jan 2022, at 12:42 AM, Eric Iverson wrote: > > Apologies for the rough start. The development

Re: [Jprogramming] ArrayFire addon

2022-01-27 Thread 'Mike Day' via Programming
I’m away from home, with only a mobile router, so I attempted the downloads at our son’s house. TalkTalk, my service provider, won’t let me send email from my laptop using his router, so perhaps it’s stopping the validation, but only after using up a GB or two of his service! Virus-checker

Re: [Jprogramming] ArrayFire addon

2022-01-27 Thread Jan-Pieter Jacobs
Thanks for the explanation Hauke. I guess that shows that I never studied computer science. I expected rows and cols to just be indices of the non-zero items, as 4&$. returns for J's sparse arrays. Anyone else wondering can refer to https://en.m.wikipedia.org/wiki/Sparse_matrix where the CRS

Re: [Jprogramming] ArrayFire addon

2022-01-26 Thread Hauke Rehr
should have read the first entry in row x … where x is the index of the number in list rows, and n is that number Am 27.01.22 um 01:25 schrieb Hauke Rehr: rows says: the first entry in col x is the n-th entry in values -- -- mail written using NEO neo-layout.org

Re: [Jprogramming] ArrayFire addon

2022-01-26 Thread Hauke Rehr
rows says: the first entry in col x is the n-th entry in values row 0 0th (if any) row 1 2nd (if any) (so in row 0 we had 2 values) row 2 3rd (if any) (so in row 1 we had 1 value) row 3 5th (if any) (so in row 2 we had 2 values) row 4 5th (if any) (so in row 3 we had 0 values) etc. Am 26.01.22

Re: [Jprogramming] ArrayFire addon

2022-01-26 Thread Jan-Pieter Jacobs
Hi, I tried out the add-on, it looks very promising! After managing to install ArrayFire (apparently the logical "apt install" didn't work), I tried the basic tutorial and found the following line causes J to segfault when using the opencl backend: display_jaf_ afaiNB. get AF text

Re: [Jprogramming] ArrayFire addon

2022-01-26 Thread Eric Iverson
I did not have any problem installing on win10. It seems win11 is tightening the rules. You will need to take some extra step to override the security check. On Wed, Jan 26, 2022 at 3:35 PM 'Mike Day' via Programming < programm...@jsoftware.com> wrote: > Just about downloading ArrayFire for

Re: [Jprogramming] ArrayFire addon

2022-01-26 Thread 'Mike Day' via Programming
Just about downloading ArrayFire for Windows 11... I tried downloading the two exe files, one for W11, which failed, and then W10, also a failure. The failures both reported inability to verify. My son has just commented that it’s a common M/S feature... Anyone else seen this behaviour?

Re: [Jprogramming] ArrayFire addon

2022-01-26 Thread 'Pascal Jasmin' via Programming
The signature for af_add: af_add (af_array *out, const af_array lhs, const af_array rhs, const bool batch) with lhs and rhs as parameter names, I don't think J users would get lost if they called the "cover function" dyadically the same way they call + I'm not suggesting altering any existing

Re: [Jprogramming] ArrayFire addon

2022-01-26 Thread Eric Iverson
Pascal, Interesting ideas on arrayfire args. I will probably resist the idea of making dop verbs dyadic. I think it better to stick closer to the arrayfire syntax. But it makes sense to avoid unnecessary boxing. af_add_jaf_ afad;afbd NB. works af_add_jaf_ afad,afbd NB. fails, but probably

[Jprogramming] ArrayFire addon

2022-01-26 Thread Eric Iverson
Apologies for the rough start. The development was done in linux with arrayfire installed and not enough attention was paid to other platforms or new users. The addon has been updated. Raul: You were on macOS, which had not been tested at all. It should work now if arrayfire is installed in

Re: [Jprogramming] ArrayFire addon

2022-01-26 Thread 'Pascal Jasmin' via Programming
An interface suggestion would be to transform all verbs that currently take 2 boxed arguments into unboxed dyad arguments. this can be done by adding the adverb (@:;) for the dop class verbs.  and (@:;~) for the reduce class verbs such that the operating axis is the x term.  The reduce class

Re: [Jprogramming] ArrayFire addon

2022-01-25 Thread 'Pascal Jasmin' via Programming
Probably not installed.  https://arrayfire.org has links installing on windows will set AF_PATH environment variable.  J accesses that. This seems better than my earlier system of hard coding/editing variables for the default path, but doesn't allow switching versions as easily. I think an

Re: [Jprogramming] ArrayFire addon

2022-01-25 Thread Eric Iverson
Pascal, Thanks for the feedback. Coming from you, it means a lot to me. There are some rough edges for windows and mac (I work mostly in linux) that I will fix tomorrow morning. On Tue, Jan 25, 2022 at 3:52 PM 'Pascal Jasmin' via Programming < programm...@jsoftware.com> wrote: > looks good. A

Re: [Jprogramming] ArrayFire addon

2022-01-25 Thread 'Pascal Jasmin' via Programming
looks good.  A small bug: if you define reduce_z_ =: ]: NB. adverb prior to loading arrayfire.ijs load will fail. The reason is the families.ijs file creates a bunch of forks with their middle verbs defined after the forks are created. An easy fix is to define all of the explicit verbs used

Re: [Jprogramming] ArrayFire addon

2022-01-25 Thread Eric Iverson
I think both problems reported so far indicate that ArrayFire is not installed or is not installed in the 'normal place'. The failure report should be made more clear. I will be able to work on this later today. On Tue, Jan 25, 2022 at 11:25 AM Michail L. Liarmakopoulos < m.l.liarm...@gmail.com>

Re: [Jprogramming] ArrayFire addon

2022-01-25 Thread Michail L. Liarmakopoulos
Hello, Eric, This is great news actually. I hope this project goes forward. That said, I've encountered an error when trying to run `init_jaf_'cpu'`, after having installed with pacman the library: ``` load'~addons/math/arrayfire/arrayfire.ijs' man_jaf_'intro' *** intro J-ArrayFire cd

Re: [Jprogramming] ArrayFire addon

2022-01-25 Thread Raul Miller
load'pacman' 'install' jpkg 'math/arrayfire' load '~addons/math/arrayfire/arrayfire.ijs' init_jaf_ 'cpu' |need to set lib: assert What step am I missing here? man_jaf_ 'intro' had said: cpu- always available and uses cpu memory and cores So perhaps this is unintended

[Jprogramming] ArrayFire addon

2022-01-25 Thread Eric Iverson
~addons/math/arrayfire is a new addon for J903 and later. The addon allows high performance computing of matrix product and many other mathematical array operations. Multiple cpu cores and hardware such as Nvidia gpus are used as appropriate. Browse https://arrayfire.org for more info. The