Skip to content

Commit b6df1c9

Browse files
Merge pull request #2 from emmenlau/master
added Windows DLL exports for all functions
2 parents cdd8e7e + fc23b5f commit b6df1c9

File tree

2 files changed

+23
-12
lines changed

2 files changed

+23
-12
lines changed

src/separableConvolution.h

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,20 @@
1010

1111
#include "standardCUDAfunctions.h"
1212

13+
#ifdef _WIN32
14+
#define FUNCTION_PREFIX extern "C" __declspec(dllexport)
15+
#else
16+
#define FUNCTION_PREFIX extern "C"
17+
#endif
18+
1319
// In-place convolution with a maximal kernel diameter of 31
14-
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 );
15-
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 );
16-
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 );
17-
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 );
18-
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 );
19-
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 );
20+
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 );
21+
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 );
22+
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 );
23+
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 );
24+
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 );
25+
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 );
2026

21-
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 );
27+
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 );
2228

2329
#endif //SEPARABLECONVOLUTION_H_

src/standardCUDAfunctions.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@
88
#ifndef STANDARDCUDAFUNCTIONS_H_
99
#define STANDARDCUDAFUNCTIONS_H_
1010

11+
#ifdef _WIN32
12+
#define FUNCTION_PREFIX extern "C" __declspec(dllexport)
13+
#else
14+
#define FUNCTION_PREFIX extern "C"
15+
#endif
1116
//----------------------------------functions to decide whhich GPU to use-------------------------------
1217

13-
extern "C" int getCUDAcomputeCapabilityMinorVersion(int devCUDA);
14-
extern "C" int getCUDAcomputeCapabilityMajorVersion(int devCUDA);
15-
extern "C" int getNumDevicesCUDA();
16-
extern "C" void getNameDeviceCUDA(int devCUDA, char *name);
17-
extern "C" long long int getMemDeviceCUDA(int devCUDA);
18+
FUNCTION_PREFIX int getCUDAcomputeCapabilityMinorVersion(int devCUDA);
19+
FUNCTION_PREFIX int getCUDAcomputeCapabilityMajorVersion(int devCUDA);
20+
FUNCTION_PREFIX int getNumDevicesCUDA();
21+
FUNCTION_PREFIX void getNameDeviceCUDA(int devCUDA, char *name);
22+
FUNCTION_PREFIX long long int getMemDeviceCUDA(int devCUDA);
1823

1924
#endif /* STANDARDCUDAFUNCTIONS_H_ */

0 commit comments

Comments
 (0)