Skip to main content
Log in

Computing matrix trigonometric functions with GPUs through Matlab

  • Published:
The Journal of Supercomputing Aims and scope Submit manuscript

Abstract

This paper presents an implementation of one of the most up-to-day algorithms proposed to compute the matrix trigonometric functions sine and cosine. The method used is based on Taylor series approximations which intensively uses matrix multiplications. To accelerate matrix products, our application can use from one to four NVIDIA GPUs by using the NVIDIA cublas and cublasXt libraries. The application, implemented in C++, can be used from the Matlab command line thanks to the mex files provided. We experimentally assess our implementation in modern and very high-performance NVIDIA GPUs.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5

Similar content being viewed by others

References

  1. Serbin SM (1979) Rational approximations of trigonometric matrices with application to second-order systems of differential equations. Appl Math Comput 5(1):75–92

    Article  MathSciNet  MATH  Google Scholar 

  2. Serbin Steven M, Blalock Sybil A (1980) An algorithm for computing the matrix cosine. SIAM J Sci Stat Comput 1(2):198–204

    Article  MathSciNet  MATH  Google Scholar 

  3. Hargreaves GI, Higham NJ (2005) Efficient algorithms for the matrix cosine and sine. Numer Algorithms 40:383–400

    Article  MathSciNet  MATH  Google Scholar 

  4. Al-Mohy Awad H, Higham Nicholas J (2009) A new scaling and squaring algorithm for the matrix exponential. SIAM J Matrix Anal Appl 31(3):970–989

    Article  MathSciNet  MATH  Google Scholar 

  5. Defez E, Sastre J, Ibáñez Javier J, Ruiz Pedro A (2011) Computing matrix functions arising in engineering models with orthogonal matrix polynomials. Math Comput Model 57:1738–1743

    Article  MathSciNet  MATH  Google Scholar 

  6. Sastre J, Ibáñez J, Ruiz P, Defez E (2013) Efficient computation of the matrix cosine. Appl Math Comput 219:7575–7585

    MathSciNet  MATH  Google Scholar 

  7. Al-Mohy Awad H, Higham Nicholas J, Relton Samuel D (2015) New algorithms for computing the matrix sine and cosine separately or simultaneously. SIAM J Sci Comput 37(1):A456–A487

    Article  MathSciNet  MATH  Google Scholar 

  8. Alonso P, Ibáñez J, Sastre J, Peinado J, Defez E (2017) Efficient and accurate algorithms for computing matrix trigonometric functions. J Comput Appl Math 309(1):325–332

    Article  MathSciNet  MATH  Google Scholar 

  9. CUBLAS library (2017) http://docs.nvidia.com/cuda/cublas/index.html. Accessed May 2017

  10. Alonso Jordá P, Boratto M, Peinado Pinilla J, Ibáñez González JJ, Sastre Martínez J (2014) On the evaluation of matrix polynomials using several GPGPUs. Universitat Politècnica de València, 2014. http://hdl.handle.net/10251/39615. Accessed Sept 2017

  11. Boratto Murilo, Alonso Pedro, Giménez Domingo, Lastovetsky Alexey L (2017) Automatic tuning to performance modelling of matrix polynomials on multicore and multi-gpu systems. J Supercomput 73(1):227–239

    Article  Google Scholar 

  12. Alonso P, Peinado J, Ibáñez J, Sastre J, Defez E (2017) A fast implementation of matrix trigonometric functions sine and cosine. In: Proceedings of the 17th International Conference on Computational and Mathematical Methods in Science and Engineering (CMMSE 2017), pp 51–55, Costa Ballena, Rota, Cadiz (Spain), July 4th–8th

  13. Sastre Jorge, Ibáñez Javier, Alonso Pedro, Peinado Jesús, Defez Emilio (2017) Two algorithms for computing the matrix cosine function. Appl Math Comput 312:66–77

    MathSciNet  MATH  Google Scholar 

  14. Paterson Michael S, Stockmeyer Larry J (1973) On the number of nonscalar multiplications necessary to evaluate polynomials. SIAM J Comput 2(1):60–66

    Article  MathSciNet  MATH  Google Scholar 

  15. Higham Nicholas J (2008) Functions of matrices: theory and computation. SIAM, Philadelphia

    Book  MATH  Google Scholar 

  16. Sastre J, Ibáñez Javier J, Defez E, Ruiz Pedro A (2011) Efficient orthogonal matrix polynomial based method for computing matrix exponential. Appl Math Comput 217:6451–6463

    MathSciNet  MATH  Google Scholar 

  17. Sastre J, Ibáñez Javier J, Defez E, Ruiz Pedro A (2015) Efficient scaling-squaring Taylor method for computing matrix exponential. SIAM J Sci Comput 37(1):A439–455

    Article  MATH  Google Scholar 

  18. Higham NJ, Tisseur F (2000) A block algorithm for matrix 1-norm estimation, with an application to 1-norm pseudospectra. SIAM J Matrix Anal Appl 21:1185–1201

    Article  MathSciNet  MATH  Google Scholar 

  19. Demmel JW (1987) A counterexample for two conjectures about stability. IEEE Trans Autom Control 32:340–343

    Article  MATH  Google Scholar 

  20. Wright Thomas G (2002) EigTool library. http://www.comlab.ox.ac.uk/pseudospectra/eigtool/. Accessed May 2017

Download references

Acknowledgements

This work has been supported by Spanish Ministerio de Economía y Competitividad and the European Regional Development Fund (ERDF) Grants TIN2014-59294-P and TEC2015-67387-C4-1-R.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Pedro Alonso.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Alonso, P., Peinado, J., Ibáñez, J. et al. Computing matrix trigonometric functions with GPUs through Matlab. J Supercomput 75, 1227–1240 (2019). https://doi.org/10.1007/s11227-018-2354-1

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11227-018-2354-1

Keywords

Navigation