NnmfPack  2.1
mlsa_cuda.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2014 by PIR (University of Oviedo) and *
3  * INCO2 (Polytechnic University of Valencia) groups. *
4  * nnmfpack@gmail.com *
5  * *
6  * This program is free software; you can redistribute it and/or modify *
7  * it under the terms of the GNU General Public License as published by *
8  * the Free Software Foundation; either version 2 of the License, or *
9  * (at your option) any later version. *
10  * *
11  * This program is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14  * GNU General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU General Public License *
17  * along with this program; if not, write to the *
18  * Free Software Foundation, Inc., *
19  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
20  ***************************************************************************
21 */
32 #ifndef MLSA_CUDA_H
33 #define MLSA_CUDA_H
34 
35 #include "utils_cuda.h"
36 
37 #define UpdateAll 1
38 #define UpdateW 2
39 #define UpdateH 3
40 
41 
42 
43 int dmlsa_cuda(const int m, const int n, const int k, const double *A, double *W, double *H, const int uType, const int nIter);
44 int smlsa_cuda(const int m, const int n, const int k, const float *A, float *W, float *H, const int uType, const int nIter);
45 
46 
47 /*support functions */
48 void ddotdiv_cuda(const int n, const double *x, const double *y, double *z, cudaStream_t stream);
49 void sdotdiv_cuda(const int n, const float *x, const float *y, float *z, cudaStream_t stream);
50 
51 /*kernels*/
52 __global__ void vddotdiv_cuda(const int n, const double* __restrict__ x, const double* __restrict__ y, double *z);
53 __global__ void vsdotdiv_cuda(const int n, const float* __restrict__ x, const float* __restrict__ y, float *z);
54 
55 #endif
int smlsa_cuda(const int m, const int n, const int k, const float *A, float *W, float *H, const int uType, const int nIter)
Header file for using utility modules from CUDA source codes.
__global__ void vddotdiv_cuda(const int n, const double *__restrict__ x, const double *__restrict__ y, double *z)
int dmlsa_cuda(const int m, const int n, const int k, const double *A, double *W, double *H, const int uType, const int nIter)
void sdotdiv_cuda(const int n, const float *x, const float *y, float *z, cudaStream_t stream)
void ddotdiv_cuda(const int n, const double *x, const double *y, double *z, cudaStream_t stream)
__global__ void vsdotdiv_cuda(const int n, const float *__restrict__ x, const float *__restrict__ y, float *z)