Skip to content

Commit

Permalink
Merge pull request #2 from emmenlau/master
Browse files Browse the repository at this point in the history
added Windows DLL exports for all functions
  • Loading branch information
StephanPreibisch committed May 8, 2015
2 parents cdd8e7e + fc23b5f commit b6df1c9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
20 changes: 13 additions & 7 deletions src/separableConvolution.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@

#include "standardCUDAfunctions.h"

#ifdef _WIN32
#define FUNCTION_PREFIX extern "C" __declspec(dllexport)
#else
#define FUNCTION_PREFIX extern "C"
#endif

// In-place convolution with a maximal kernel diameter of 31
extern "C" int convolve_255( float *image, float *kernelX, float *kernelY, float *kernelZ, int imageW, int imageH, int imageD, int convolveX, int convolveY, int convolveZ, int outofbounds, float outofboundsvalue, int devCUDA );
extern "C" int convolve_127( float *image, float *kernelX, float *kernelY, float *kernelZ, int imageW, int imageH, int imageD, int convolveX, int convolveY, int convolveZ, int outofbounds, float outofboundsvalue, int devCUDA );
extern "C" int convolve_63( float *image, float *kernelX, float *kernelY, float *kernelZ, int imageW, int imageH, int imageD, int convolveX, int convolveY, int convolveZ, int outofbounds, float outofboundsvalue, int devCUDA );
extern "C" int convolve_31( float *image, float *kernelX, float *kernelY, float *kernelZ, int imageW, int imageH, int imageD, int convolveX, int convolveY, int convolveZ, int outofbounds, float outofboundsvalue, int devCUDA );
extern "C" int convolve_15( float *image, float *kernelX, float *kernelY, float *kernelZ, int imageW, int imageH, int imageD, int convolveX, int convolveY, int convolveZ, int outofbounds, float outofboundsvalue, int devCUDA );
extern "C" int convolve_7( float *image, float *kernelX, float *kernelY, float *kernelZ, int imageW, int imageH, int imageD, int convolveX, int convolveY, int convolveZ, int outofbounds, float outofboundsvalue, int devCUDA );
FUNCTION_PREFIX int convolve_255( float *image, float *kernelX, float *kernelY, float *kernelZ, int imageW, int imageH, int imageD, int convolveX, int convolveY, int convolveZ, int outofbounds, float outofboundsvalue, int devCUDA );
FUNCTION_PREFIX int convolve_127( float *image, float *kernelX, float *kernelY, float *kernelZ, int imageW, int imageH, int imageD, int convolveX, int convolveY, int convolveZ, int outofbounds, float outofboundsvalue, int devCUDA );
FUNCTION_PREFIX int convolve_63( float *image, float *kernelX, float *kernelY, float *kernelZ, int imageW, int imageH, int imageD, int convolveX, int convolveY, int convolveZ, int outofbounds, float outofboundsvalue, int devCUDA );
FUNCTION_PREFIX int convolve_31( float *image, float *kernelX, float *kernelY, float *kernelZ, int imageW, int imageH, int imageD, int convolveX, int convolveY, int convolveZ, int outofbounds, float outofboundsvalue, int devCUDA );
FUNCTION_PREFIX int convolve_15( float *image, float *kernelX, float *kernelY, float *kernelZ, int imageW, int imageH, int imageD, int convolveX, int convolveY, int convolveZ, int outofbounds, float outofboundsvalue, int devCUDA );
FUNCTION_PREFIX int convolve_7( float *image, float *kernelX, float *kernelY, float *kernelZ, int imageW, int imageH, int imageD, int convolveX, int convolveY, int convolveZ, int outofbounds, float outofboundsvalue, int devCUDA );

extern "C" void convolutionCPU( float *image, float *kernelX, float *kernelY, float *kernelZ, int kernelRX, int kernelRY, int kernelRZ, int imageW, int imageH, int imageD, int outofbounds, float outofboundsvalue );
FUNCTION_PREFIX void convolutionCPU( float *image, float *kernelX, float *kernelY, float *kernelZ, int kernelRX, int kernelRY, int kernelRZ, int imageW, int imageH, int imageD, int outofbounds, float outofboundsvalue );

#endif //SEPARABLECONVOLUTION_H_
15 changes: 10 additions & 5 deletions src/standardCUDAfunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@
#ifndef STANDARDCUDAFUNCTIONS_H_
#define STANDARDCUDAFUNCTIONS_H_

#ifdef _WIN32
#define FUNCTION_PREFIX extern "C" __declspec(dllexport)
#else
#define FUNCTION_PREFIX extern "C"
#endif
//----------------------------------functions to decide whhich GPU to use-------------------------------

extern "C" int getCUDAcomputeCapabilityMinorVersion(int devCUDA);
extern "C" int getCUDAcomputeCapabilityMajorVersion(int devCUDA);
extern "C" int getNumDevicesCUDA();
extern "C" void getNameDeviceCUDA(int devCUDA, char *name);
extern "C" long long int getMemDeviceCUDA(int devCUDA);
FUNCTION_PREFIX int getCUDAcomputeCapabilityMinorVersion(int devCUDA);
FUNCTION_PREFIX int getCUDAcomputeCapabilityMajorVersion(int devCUDA);
FUNCTION_PREFIX int getNumDevicesCUDA();
FUNCTION_PREFIX void getNameDeviceCUDA(int devCUDA, char *name);
FUNCTION_PREFIX long long int getMemDeviceCUDA(int devCUDA);

#endif /* STANDARDCUDAFUNCTIONS_H_ */

0 comments on commit b6df1c9

Please sign in to comment.