The problem with remapping the functions is that then you have to have all the different functions co-resident, which means that you have to tell the compiler that it knows AVX2, and then it is liable to use AVX2 instructions all over the place, so you can't run on non-AVX machines anyway.  Different compilers have different approaches to this.

Henry Rich

On 10/7/2020 8:26 AM, Raul Miller wrote:
There's https://github.com/google/cpu_features

But probably this issue would be better dealt with in a script than in
libj. You can include a libj-avx and a libj-noavx and symlink the
appropriate one or use secondary packages or rename one libj and
delete the other or any of a variety of other techniques, depending on
what seems best for the distro in question. Part of the reason I am
thinking this is that the parts of the code where this decision needs
to be made tends to be performance critical, so it's best to make the
decision once, ahead of time.

(And of course if you're on linux you can look in /proc/cpuinfo to
determine whether avx is supported.)

Thanks,

--
Raul




On Tue, Oct 6, 2020 at 11:42 PM ethiejiesa via General
<[email protected]> wrote:
Forgive me for piggy-backing on OP, but would upstream be interested in work on
merging the separate non-avx, avx, and avx2 outputs into a single libj.so that
auto-detects cpu features at startup and sets up the primitive-to-function map
accordingly?

I don't have concrete work in this direction, but I do have some bit of
background in doing things like this.

As the package manager of J for a couple Linux distros, we have to ship all the
binaries anyway and write a wrapper script to detect CPU features at startup
anyway, so along this single dimension it would be a win.

My question is which way upstream's cost-benefit scale tips when considering
everything else.

Cheers!

Raul Miller <[email protected]> wrote:
Wikipedia concurs:
https://en.wikipedia.org/wiki/List_of_Intel_Core_M_microprocessors

Also, on a macbook, you can run this command line in terminal to see
what cpu features are supported on your machine:

sysctl machdep.cpu.features

Thanks,

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


--
This email has been checked for viruses by AVG.
https://www.avg.com

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

Reply via email to