1

Assuming that we have a C vector real myVector[50] = {3,2.2,31...} and I want to turn take the abs, than or sin or why not max(0, m) or sigmoid.

Is there any BLAS routine for that, or do I need to use a for-loop? Can I improve the for-loop if there is no BLAS routines for what I'm seeking?

enter image description here

euraad
  • 2,467
  • 5
  • 30
  • 51
  • No there is not. Implement yourself. What precision are you interested in? – Kaveh Vahedipour Sep 02 '19 at 18:31
  • @KavehVahedipour 0.001 only. I have made a file here: https://github.com/DanielMartensson/Deeplearning2C/blob/master/Deeplearning2CApp/src/main/resources/se/danielmartensson/views/blas/activation.c – euraad Sep 02 '19 at 18:53
  • You can accelerate that code on `AVX`-capable CPUs easily by factor 8: https://github.com/kvahed/codeare/blob/master/src/matrix/SIMDTraits.hpp Now, the above code is C++, but you should be able to get the idea. I am using the C-API for the vector intrinsics for amd64 CPUs. – Kaveh Vahedipour Sep 03 '19 at 08:24

0 Answers0