GPUMLib  0.2.2
GPU Machine Learning Library
rankernels.h
1 /*
2  Ricardo Quintas is an MSc Student at the University of Coimbra, Portugal
3  Copyright (C) 2009, 2010 Ricardo Quintas
4 
5  This file is part of GPUMLib.
6 
7  GPUMLib is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
23 
24 #ifndef RANkernels_h
25 #define RANkernels_h
26 
27 #include "../common/CudaDefinitions.h"
28 #include "../memory/DeviceArray.h"
29 #include "../memory/DeviceMatrix.h"
30 #include "../memory/HostArray.h"
31 #include "../memory/HostMatrix.h"
32 
33 /*Define functions to call CUDA kernels in C program*/
34 extern "C" void FindMin(cudafloat *Output, int output_height, int output_width, float *min_array, int* min_idx,cudafloat* Targets);
35 extern "C" void KernelEuclidianDistance(cudafloat *Output, int output_height, int output_width, cudafloat *Input, int input_width, cudafloat *Centers, int centers_width);
36 
37 extern "C" void KernelFindNearestCenter(cudafloat *Output, int output_width, cudafloat *Sample, cudafloat *Centers, int centers_width, float* min_value);
38 
39 extern "C" void KernelActivationMatrix(cudafloat *Output, int output_height, int output_width, cudafloat *Input, int input_width, cudafloat *Centers, int centers_width, float *c_width, float scalingfactor);
40 
41 extern "C" void KernelSigmaInverse(float *Output, int output_width, int output_height, cudafloat *S);
42 
43 extern "C" unsigned int nextPow2( unsigned int x );
44 extern "C" cudafloat KernelCalculateDistance(cudafloat *output, cudafloat *A, cudafloat *B,int n);
45 
46 extern "C" void matmul(cudafloat *d_C, cudafloat* d_A, cudafloat* d_B,int uiWA,int uiWB, int uiWC, int uiHC);
47 
48 extern "C" void KernelCalculateNetworkActivation(cudafloat* output, cudafloat* Sample,int Length,cudafloat* dCenters,int NumCenters,cudafloat* dWeights,int NumClasses,cudafloat* dWidths,float scaling_factor);
49 
50 extern "C" void KernelUpdateWidths(cudafloat* dWidths, cudafloat* newWidths, int Length);
51 
52 
53 extern "C" void KernelCalculateError(cudafloat* result, cudafloat* target, cudafloat* output, int Length, float* error);
54 
55 extern "C" void KernelSumActivations(cudafloat* output, int Length, int NumCenters);
56 
57 
58 
59 
60 
61 extern "C" void KernelCopyTo(cudafloat* dCenters, cudafloat *Sample,int Length);
62 
63 #endif
64 
65 
66 //! @}
void KernelSigmaInverse(float *Output, int output_height, int output_width, cudafloat *S)
Definition: RANKernels.cu:217
void KernelEuclidianDistance(cudafloat *d_C, cudafloat *d_A, cudafloat *d_B, int uiWA, int uiWB, int uiWC, int uiHC)
float cudafloat