NnmfPack  2.1
mlsa_mic.c
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 #include "mlsa_mic.h"
33 
72 int dmlsa_mic(const int m, const int n, const int k, const double *A, double *W, double *H, const int uType, const int nIter)
73 {
74  int error=0;
75 
76  #ifdef With_MICOffload
77  #pragma offload target(mic:0) \
78  in(m,n,k,nIter) \
79  in(A:length(m*n)) \
80  inout(W:length(m*k)) \
81  inout(H:length(k*n)) \
82  inout(error)
83  {
84  #else
85  mkl_mic_enable();
86  #endif
87 
88  error = dmlsa_cpu(m, n, k, A, W, H, uType, nIter);
89 
90  #ifdef With_MICOffload
91  }
92  #endif
93 
94  return error;
95 }
96 
97 
111 int smlsa_mic(const int m, const int n, const int k, const float *A, float *W, float *H, const int uType, const int nIter)
112 {
113  int error=0;
114 
115  #ifdef With_MICOffload
116  #pragma offload target(mic:0) \
117  in(m,n,k,nIter) \
118  in(A:length(m*n)) \
119  inout(W:length(m*k)) \
120  inout(H:length(k*n)) \
121  inout(error)
122  {
123  #else
124  mkl_mic_enable();
125  #endif
126 
127  error = smlsa_cpu(m, n, k, A, W, H, uType, nIter);
128 
129  #ifdef With_MICOffload
130  }
131  #endif
132 
133  return error;
134 }
int dmlsa_cpu(const int m, const int n, const int k, const double *A, double *W, double *H, const int uType, const int nIter)
dmlsa_cpu performs NNMF using betadivergence when beta=2 using double precision
Definition: mlsa_cpu.c:74
Header file for using the mlsa algorithm with MIC/MIC.
int smlsa_cpu(const int m, const int n, const int k, const float *A, float *W, float *H, const int uType, const int nIter)
smlsa_cpu performs NNMF using betadivergence when beta=2 using simple precision
Definition: mlsa_cpu.c:275
int smlsa_mic(const int m, const int n, const int k, const float *A, float *W, float *H, const int uType, const int nIter)
smlsa_mic performs NNMF using betadivergence when beta=2 using simple precision
Definition: mlsa_mic.c:111
int dmlsa_mic(const int m, const int n, const int k, const double *A, double *W, double *H, const int uType, const int nIter)
dmlsa_mic performs NNMF using betadivergence when beta=2 using double precision
Definition: mlsa_mic.c:72