<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Declare LAPACK/BLAS in mkl_rt.dll in VBA Excel in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Declare-LAPACK-BLAS-in-mkl-rt-dll-in-VBA-Excel/m-p/1190545#M29715</link>
    <description>&lt;P&gt;Hi guys,&lt;/P&gt;
&lt;P&gt;I have problems with these issues below and need your help to solve them. I used default mkl_rt.dll, I do not build any custom DLL currently.&lt;/P&gt;
&lt;P&gt;1. Are there any documents that give the instruction on how to use ByVal or ByRef for each type of variable in LAPACK/BLAS function in&amp;nbsp;mkl_rt.dll? (&lt;SPAN&gt;DGETRF/DGETR for example)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2. How can I define which functions&amp;nbsp;are the STDCALL version?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;3. The codes below worked on Excel 64 bit and Windows 64 bit, however, they cannot work&amp;nbsp;on Excel 32 bit and Windows 64 bit. Could you help me with this issue? (I deleted "PtrSafe" in Excel 32 bit). Sometimes, The "&lt;STRONG&gt;Bad DLL calling convention (Error 49)"&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp; appears, most of time the excel just crash.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;&lt;LI-CODE lang="markup"&gt;Private Declare PtrSafe Function dgetrf Lib "mkl_rt.dll" _
    (ByRef M As Integer, _
     ByRef N As Integer, _
     ByRef A As Double, _
     ByRef LDA As Integer, _
     ByRef IPIV As Integer, _
     ByRef INFO As Integer)

Private Declare PtrSafe Function dgetri Lib "mkl_rt.dll" _
    (ByRef N As Integer, _
    ByRef A As Double, _
    ByRef LDA As Integer, _
    ByRef IPIV As Integer, _
    ByRef WORK As Double, _
    ByRef LWORK As Integer, _
    ByRef INFO1 As Integer)
        &lt;/LI-CODE&gt;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4. Should I continue research this issue or I have to build my custom DLL which includes all&amp;nbsp;needed LAPACK/BLAS function to use in VBA?&lt;/P&gt;
&lt;P&gt;Please let me know if you need more information.&lt;/P&gt;
&lt;P&gt;Thank you for your understanding.&lt;/P&gt;</description>
    <pubDate>Wed, 08 Jul 2020 07:06:26 GMT</pubDate>
    <dc:creator>Ngo__Nhan</dc:creator>
    <dc:date>2020-07-08T07:06:26Z</dc:date>
    <item>
      <title>Declare LAPACK/BLAS in mkl_rt.dll in VBA Excel</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Declare-LAPACK-BLAS-in-mkl-rt-dll-in-VBA-Excel/m-p/1190545#M29715</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;
&lt;P&gt;I have problems with these issues below and need your help to solve them. I used default mkl_rt.dll, I do not build any custom DLL currently.&lt;/P&gt;
&lt;P&gt;1. Are there any documents that give the instruction on how to use ByVal or ByRef for each type of variable in LAPACK/BLAS function in&amp;nbsp;mkl_rt.dll? (&lt;SPAN&gt;DGETRF/DGETR for example)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2. How can I define which functions&amp;nbsp;are the STDCALL version?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;3. The codes below worked on Excel 64 bit and Windows 64 bit, however, they cannot work&amp;nbsp;on Excel 32 bit and Windows 64 bit. Could you help me with this issue? (I deleted "PtrSafe" in Excel 32 bit). Sometimes, The "&lt;STRONG&gt;Bad DLL calling convention (Error 49)"&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp; appears, most of time the excel just crash.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;&lt;LI-CODE lang="markup"&gt;Private Declare PtrSafe Function dgetrf Lib "mkl_rt.dll" _
    (ByRef M As Integer, _
     ByRef N As Integer, _
     ByRef A As Double, _
     ByRef LDA As Integer, _
     ByRef IPIV As Integer, _
     ByRef INFO As Integer)

Private Declare PtrSafe Function dgetri Lib "mkl_rt.dll" _
    (ByRef N As Integer, _
    ByRef A As Double, _
    ByRef LDA As Integer, _
    ByRef IPIV As Integer, _
    ByRef WORK As Double, _
    ByRef LWORK As Integer, _
    ByRef INFO1 As Integer)
        &lt;/LI-CODE&gt;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4. Should I continue research this issue or I have to build my custom DLL which includes all&amp;nbsp;needed LAPACK/BLAS function to use in VBA?&lt;/P&gt;
&lt;P&gt;Please let me know if you need more information.&lt;/P&gt;
&lt;P&gt;Thank you for your understanding.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2020 07:06:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Declare-LAPACK-BLAS-in-mkl-rt-dll-in-VBA-Excel/m-p/1190545#M29715</guid>
      <dc:creator>Ngo__Nhan</dc:creator>
      <dc:date>2020-07-08T07:06:26Z</dc:date>
    </item>
    <item>
      <title>Re:Declare LAPACK/BLAS in mkl_rt.dll in VBA Excel</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Declare-LAPACK-BLAS-in-mkl-rt-dll-in-VBA-Excel/m-p/1190660#M29718</link>
      <description>&lt;OL&gt;
&lt;LI&gt;There is no such documentation or instructions as mkl is never validated/tested under this environment.&lt;/LI&gt;
&lt;LI&gt;Please refer to the mkl user’s guide to see more details about stdcall&lt;/LI&gt;
&lt;LI&gt;No comments&lt;/LI&gt;
&lt;LI&gt;I don’t think you need to build the custom dll in that case. It will not help you to resolve the problem.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jul 2020 13:22:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Declare-LAPACK-BLAS-in-mkl-rt-dll-in-VBA-Excel/m-p/1190660#M29718</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2020-07-08T13:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Re:Declare LAPACK/BLAS in mkl_rt.dll in VBA Excel</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Declare-LAPACK-BLAS-in-mkl-rt-dll-in-VBA-Excel/m-p/1190921#M29734</link>
      <description>&lt;P&gt;Hi Gennady,&lt;/P&gt;
&lt;P&gt;Thank you for your answer, I will try other libraries to find the best match.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jul 2020 07:02:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Declare-LAPACK-BLAS-in-mkl-rt-dll-in-VBA-Excel/m-p/1190921#M29734</guid>
      <dc:creator>Ngo__Nhan</dc:creator>
      <dc:date>2020-07-09T07:02:40Z</dc:date>
    </item>
  </channel>
</rss>

