Create a DLL with Visual Studio 2008

I want to create a DLL-File with Visual Studio 2008.

First I have modify the project “simpleFFT”. Then I have compiled the project. The DLL-File was created, but I cant import the DLL-File in Labview, because the import wizard cant find the function name.

Here is my code:

// includes, system

#include <stdlib.h>

#include <stdio.h>

#include <string.h>

#include <math.h>

// includes, project

#include <cufft.h>

#include <cutil_inline.h>

#include “C:\Program Files\National Instruments\LabVIEW 8.6\cintools\extcode.h”

__declspec(dllexport) void Window_For_FFT(unsigned int Data_In, unsigned int Filter_Value);

static global void window(float *Data_In, float *Filter_Value , int, int);

void Window_For_FFT(float *Data_In, float *Filter_Value)

{

dim3 dimGrid;

dim3 dimBlock;

dimBlock.x = 512;

dimBlock.y = 1;

dimGrid.x = 2;

dimGrid.y = 1000;

window<<<dimGrid, dimBlock>>>(Data_In, Filter_Value, 1000, 1024);

}

// Fenster für FFT berechnen

global void window(float *waveform, float *coeff, int n_waveform, int number_of_coefficients)

{

int tidx = threadIdx.x + blockIdx.x*blockDim.x;

int tidy = threadIdx.y + blockIdx.y*blockDim.y;

if( tidx >= number_of_coefficients )

{

    return;

}

if( tidy >= n_waveform )

{

    return;

}

waveform[tidy * number_of_coefficients + tidx] = waveform[tidy * number_of_coefficients + tidx] * coeff[tidx];

}

I use only one cu-file.

Here is my code
simpleCUFFT.zip (412 KB)

This must be possible, because I can import the CUFFT.dll in Labview. However how can I create my own dll-file with visual studio 2008 or 2005. I use CUDA 2.1

Have nobobody an idea?

Hmm…I’ve got just a tiny bit of experience with LabView, which I understand was written totally in .NET (or, at least the new versions are). A temporary workaround might be to download and import CUDA.NET into your LabView project and use it’s functions to call your windowing kernel and then CUFFT. You’d have to compile your windowing kernel into a .cubin object first though, in order to load it with CUDA.NET.

Edit: Why is your DLL exporting a signature that takes unsigned int arrays when your actual function takes floats? They should be the same size anyway…but maybe it matters for some reason? Like the function signatures don’t match in the DLL or something?

Don’t you have a header file for your DLL project? Do you have to do all those configurations like “additional include paths, additional library”?

I am trying to create a DLL from my CUDA program. I have my header file “example.h” as this

[codebox]#if !defined EXAMPLE_H

define EXAMPLE_H

ifdef __cplusplus

extern “C”{

else

endif

ifdef EXAMPLE_BLD

define DLL __declspec(dllexport)

else

define DLL

endif

my typedef here;

void DLL mycudafunction(parameters);

ifdef __cplusplus

}

endif

endif[/codebox]

I also have my CUDA program cudafunction.cu in which I included all the standard headers and cuda headers will be used, and also included example.h.

I did all the configuration work as stated here: http://llpanorama.wordpress.com/2008/05/21…t-cuda-program/

But when building my dll project, I still get many errors about cuda identifiers. It seems that my .cu file was not correctly compiled.

Btw, my cudafunction.cu was running correctly before I changed it to DLL function. I am using visual studio 2008 with cuda vs wizard 2.0 installed. Since I am creating a DLL project, I did all the configurations for the project and .cu file.

Anyone has any idea about how to make it work?

Thanks,

Yuping

You could try watching the videos Sarnath uploaded in the following post
[url=“http://forums.nvidia.com/index.php?s=&showtopic=97928&view=findpost&p=547375”]http://forums.nvidia.com/index.php?s=&...st&p=547375[/url]