OpenGL Fortran on Windows - Matrix Math

OpenGL Fortran on Windows - Matrix Math

tiddles's picture

Is there anyone who knows whether matrix calculations could be executed faster using OpenGL routines (e.g.,glMultMatrixf, glRotatef) rather than the intrinsic matmul? We have already checked out Visual Basic and found that even if VB applied DirectX math routines (e.g., D3DXMatrixMultiply), it is still more than twice as slow as optimised Fortran with intrinsic math functions.
An example would be helpful to illustrate any reply. Thanks in advance for any assistance.

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Tim Prince's picture

You don't present enough information to answer. Intel MKL is likely to be the fastest, if your matrix dimensions are appropriate (large enough). CVF 6.6 does an excellent job expanding MATMUL() with small fixed dimensions in line.

Community Admin's picture

In general you are better off using the GL/D3D transform calls. On machines with accelerated graphics, the matrix calculations will be performed on the adapter which should be faster than using the host cpu. Also using 3D routines results in less data that needs to be sent to the adapter. e.g. glRotatef sends 4 floats to the pipe vs glLoadMatrixf with 16 floats.

John

Login to leave a comment.