4 ms·
> Writing a kernel in C means using SIMD intrinsics, where function names and types differ for every vector size, and then different numbers/sets of calls for e
by marmaduke 8y ago
> Writing a kernel in C means using SIMD intrinsics, where function names and types differ for every vector size, and then different numbers/sets of calls for each kernel (you'd want several sizes per architecture)
This is not true for any recent, competent compiler. I can write a template function in C++ code with a regular loop over arrays and it gets vectorized withSIMD instructions automatically according to architecture. Sure, it’s not JIT but it still never requires intrinsics
- pjmlp 8y agoSure you can, but when one weights the language complexities and opportunities for unsafe code/UB, Julia certainly wins in productivity.
- marmaduke 8y agoIf you can deploy that runtime maybe. How well does Julia work when you need to ship a static library?
- pjmlp 8y agoAs far as I know, Julia only allows for dynamic libraries. https://github.com/JuliaLang/PackageCompiler.jl https://github.com/JuliaLang/PackageCompiler.jl Which really for me they are good enough, I don't remember the last time I cared about producing a .a/.lib file for delivery.
- ChrisRackauckas 8y agoIt can make static libraries. There are some old blog posts on how it can be done. No one has packaged it up though, and it will always be limited to chosen specializations of course.
- dnautics 8y agoUse a container. I recommend singularity, works great with julia. Shipped a single binary, deployed on a supercompute center, ran 20 batches over 500 nodes, 16 cores per node, no problem.
- marmaduke 8y agoThanks I know how to container in HPC, question was about shipping libraries.
- dnautics 8y agoThen you are constructing a problem specifically for julia to fail. Congratulations on being a jerk that doesn't pose a question that is relevant to anyone's real use case. Counter question: Can you in 24 hours ship a binary library built in C or C++ that in guaranteed to work on ARM, x86, and also detect NVIDIA or AMD GPUs and use those for acceleration as needed?
- 3rdAccount 8y agoThe container has the OS, Julia install, and code?
- celrod 8y agoThe problem isn't just whether or not it uses SIMD instructions, but avoiding redundant and unnecessary `vmov` instructions. For example, I filed a bug here: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86625 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86625 because unless I use SIMD intrinsics, while the code is vectorized, there is a high density of unnecessary move instructions resulting in dramatically slower code. Using SIMD intrinsics in C avoids that problem.
- dnautics 8y ago> This is not true for any recent, competent compiler. I can write a template function in C++ code with a regular loop over arrays and it gets vectorized withSIMD instructions automatically according to architecture. Sure, it’s not JIT but it still never requires intrinsics The relevant comparison here is against matlab. If you want to spend two weeks writing and debugging an optimized version of matrix mult for a custom type in c/c++, that's your business, but one can do it in a day in julia and be fairly confident it will just work.