Hi All,
Is possible to implement the dynamic linking: import a DLL file in a cuda kernel? With the following code for the CPU I can load at run-time a function previously compiled in an extern DLL:
#include <windows.h>
#include <iostream.h>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#define MAXMODULE 50
typedef void (WINAPI*cfunc)(…);
cfunc NumberList;
int main (int argc, char *argv){
char pippo=“DLLTEST.DLL”;
HINSTANCE hLib=LoadLibrary(pippo);
if(hLib==NULL) {
cout<< "Impossibile caricare la libreria!"<< endl;
getch();
return 0;
}
char mod[MAXMODULE];
GetModuleFileName((HMODULE)hLib, (LPTSTR)mod, MAXMODULE);
cout <<"Libreria caricata: "<<mod<<endl;
char nomeFunz[]="Somma";
NumberList=(cfunc)GetProcAddress((HMODULE)hLib,nomeFunz);
NumberList(atoi(argv[1]),atoi(argv[2]));
FreeLibrary((HMODULE)hLib);
getch();
}
Thanks.