Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
Is there a source code for a fast implementation of natural logarithm, for __m256 type, for AVX?
There is fmath, but it only works for __m128
Glibc has AVX[-512] SIMD log and logf implementations in the github repository: sysdeps/x86_64/fpu/multiarch. It relies on a lot of support code, like polynomial coefficient data, macros, support functions, etc. Much of this is in the parent fpu directory.
GNU libc's license is LGPLv2, so you can dynamically link it from any software, but only copy the source into GPL-compatible projects.
Agner Fog's Vector Class Library (VCL) is now Apache-licensed, and also has some SIMD math functions. It can be used with __m256, implicitly converting to/from its internal Vec8f type.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I can't search what does the logarithm code look like in C++? What the code of the logarithm function looks like in C++ in the library cmath? Exactly the code. I don't need to figure out how I can get the logarithm. I want to know how this algorithm works.
You would be very disappointed. On modern processors, the C++ compiler inserts the assembly instruction that obtains it from the floating-point ALU. There is no code.
That is implementation specific and therefore can vary from system to system.
Since there are several ways to compute a logarithm, a good book on this kind of algorithm is a good start.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I want to use half-precision arithmetic on Cortex-A76. I installed clang compiler to use _Float16 data type (which is for 16-bit arithmetic purpose).
I was wondering is there any library for half-precision mathematic functions? (like for quadruple-precision numbers)
or which math functions are available for half-precision numbers? I checked the math.h library and there are functions just for double and float. Am I right?
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
What is a general way to look at LLVM and find the corresponding calls in the C++ API?
For example, I have the logical and instruction which corresponds to the Language reference here.
How can I find a corresponding C++ API reference? My general approach would be to put "llvm add instruction C++ API" into a search engine, but this isn't consistently useful.
Usually for an someinst instruction there is a SomeInstInst class. For instance, alloca is implemented by AllocaInst.
But not for add, that's what confused you. Binary arithmetic and logical instructions are implemented using single class called BinaryOperator.
Another exception is a phi instruction - it is implemented in the PHINode class. Other than that, figuring what class you need should be pretty straightforward.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
The TensorFlow white paper mentions that Eigen is used. Are there public explanations for how Eigen was chosen, and are they motivation for using Eigen in TensorFlow C++ op kernels?
I think that one of the key feature that drove the use of Eigen in the first place is because Eigen features its own highly optimized matrix product kernels whereas all other competitors have to be linked to some BLAS libraries. Moreover, the code of Eigen's product kernel is C++ with easy access to low-level internal kernels, so it was 'easy' for them to tweak and extend it to match their needs. This way Google has been able to develop the Tensor module with high CPU performance in a pure header-only fashion. The support for CUDA and now OpenCL via SyCL came later, those are not intrinsic features of Eigen that drove the initial choice.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I cannot use gsl_matrix because my app is closed source and, according to this question, if I used GPL code directly, I'd have to make my app open source. And that's a no-no from the higher ups.
So... Does Boost, or even better, TR1, have a library with classes equivalent to gsl_matrix, gsl_vector and other types from the GNU Scientific Library? If there are such classes, how are they called?
Edit: I need to:
Perform dense matrix-vector products and sums (like gsl_blas_dgemv and gsl_blas_dgemm do)
Optionally, solve quadratic programming models.
First of all, there is C interface for BLAS/LAPACK. Some people find it 'hard' to deal with the call signatures which directly mirror the original BLAS ones.
If you're more into fancier side of things, there's Boost uBLAS interface, there's Armadillo, to name just two. Performance-wise, your mileage may vary.