I try to use mklml.dll with my script but somehow I'm unable to load any functions from it
I already use this method for libopenblas.dll and everything work fine. I also watch mklml.dll witch DllExplorer so I'm 100% sure certain function even exist.
my pc spec:
W7Ux64
AHK 1.1.30.01 U64
any suggestion what is going wrong?
dll files: https://github.com/intel/mkl-dnn/releases/tag/v0.17.4
Code: Select all
;msgbox,% "Hello"
vsSub(0,0,0,0)
return
dll_getAdr(dllFile,func){
if(!InStr(FileExist(dllFile),"A")){
msgbox,% "Not found dll: " dllFile "`n" func
}
handle := DllCall("LoadLibrary","Str",dllFile)
DllError("LoadLibrary",handle,A_LastError,ErrorLevel,dllFile "/" func)
adr := DllCall("GetProcAddress","Ptr",handle,"AStr",func,"Ptr")
DllError("GetProcAddress",adr,A_LastError,ErrorLevel,dllFile "/" func)
return adr
}
vsSub(cnt,a,b,r){
;msgbox,% A_ThisFunc "`n" a "`n" b "`n" r
;r[i] = a[i] - b[i]
static dllFile := "mklml.dll"
static vsSub := dll_getAdr(dllFile,"vsSub")
msgbox,% vsSub
;DllCall(vsSub
;,"int",cnt
;,"ptr",a
;,"ptr",b
;,"ptr",r
;,"cdecl")
}
DllError(fName,ret,LastError,EL,param){
;if(ret==0 || LastError!=0){
if(ret==0){ ;lastError==127 falszywe?
msgbox,% "Function: " fName
. "`nreturn: " ret
. "`nErrorLevel: " EL
. "`nLastErrorCode: " A_LastError
. "`nLastErrorMessage: " GetErrorString(A_LastError)
. "`nParam: " param
}
}
GetErrorString(Errornumber)
{
bufferSize = 1024 ; Arbitrary, should be large enough for most uses
VarSetCapacity(buffer, bufferSize, 0)
FORMAT_MESSAGE_FROM_SYSTEM = 0x1000
LANG_SYSTEM_DEFAULT = 0x10000
LANG_USER_DEFAULT = 0x20000
DllCall("FormatMessage"
, "UInt", FORMAT_MESSAGE_FROM_SYSTEM
, "UInt", 0
, "UInt", Errornumber
, "UInt", LANG_USER_DEFAULT
, "Str" , buffer
, "UInt", bufferSize
, "UInt", 0)
return buffer
}