Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Using both BLAS and VML in VBA

personalityson
Beginner
336 Views

Hi,

In VBA Excel I am able to declare an API function call for dgemm (Fortran version). I'm linking directly to mkl_rt.2.dll in the bin directory. I tested it and it works fine.

I'm doing the same with some VML functions, they also work, but after calling one of them, let' say vdSub, dgemm stopped working.

I understand that running VML functions for the first time changes the settings somehow?

What can I do to be able to use both at the same time?

 

Not sure if relevant:

Private Declare PtrSafe Sub vdSub Lib "mkl_rt.2.dll" (ByRef n As Long, _
                                                      ByVal A As LongPtr, _
                                                      ByVal B As LongPtr, _
                                                      ByVal Y As LongPtr)

Private Declare PtrSafe Sub dgemm Lib "mkl_rt.2.dll" (ByRef transA As String, _
                                                      ByRef transB As String, _
                                                      ByRef m As Long, _
                                                      ByRef n As Long, _
                                                      ByRef k As Long, _
                                                      ByRef alpha As Double, _
                                                      ByVal A As LongPtr, _
                                                      ByRef ldA As Long, _
                                                      ByVal B As LongPtr, _
                                                      ByRef ldB As Long, _
                                                      ByRef beta As Double, _
                                                      ByVal C As LongPtr, _
                                                      ByRef ldC As Long)
0 Kudos
2 Replies
Mark_L_Intel
Moderator
222 Views

Hello @personalityson,

 

   Have you tried working directly with oneMKL? I don't believe we support/test the VB interface with oneMKL. However, please provide more details -- versions of Visual Studio and oneMKL, etc.   Please also look at the previous posts, e.g., https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Declaring-BLAS-functions-from-mkl-rt-dll-in-VBA-Excel/td-p/1093299.   

0 Kudos
personalityson
Beginner
204 Views

Thanks for replying to me. I think I'll just end up compiling my own stand-alone dll's, one for BLAS and one for VML.

0 Kudos
Reply