Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 7b88ca8f authored by Adrien Leman's avatar Adrien Leman Committed by hhakim
Browse files

add faust_prox

parent e13abb8f
Branches
Tags
No related merge requests found
......@@ -2,14 +2,6 @@
#define __LINALGEBRA_GPU_HPP__
//modif AL
//#define __COMPILE_SPMAT__
//#include "faust_linear_algebra_gpu.h"
//#include "faust_constant.h"
using namespace std;
......
#ifndef __PROX_GPU_H__
#define __PROX_GPU_H__
#include "faust_MatDense_gpu.h"
#include "faust_constant_gpu.h"
#include "faust_exception.h"
namespace Faust
{
template<typename FPP>
void prox_sp(Faust::MatDense<FPP,Gpu> & M,faust_unsigned_int k);
template<typename FPP>
void prox_sp_pos(Faust::MatDense<FPP,Gpu> & M,faust_unsigned_int k);
template<typename FPP>
void prox_spcol(Faust::MatDense<FPP,Gpu> & M,faust_unsigned_int k);
template<typename FPP>
void prox_splin(Faust::MatDense<FPP,Gpu> & M,faust_unsigned_int k);
template<typename FPP>
void prox_splincol(Faust::MatDense<FPP,Gpu> & M,faust_unsigned_int k);
template<typename FPP>
void prox_normcol(Faust::MatDense<FPP,Gpu> & M,FPP s);
template<typename FPP>
void prox_normlin(Faust::MatDense<FPP,Gpu> & M,FPP s);
template<typename FPP>
void prox_supp(Faust::MatDense<FPP,Gpu> & M, const Faust::MatDense<FPP,Gpu> & supp);
template<typename FPP>
void prox_blkdiag(Faust::MatDense<FPP,Gpu> & M,faust_unsigned_int k);
template<typename FPP>
void prox_splincol(Faust::MatDense<FPP,Gpu> & M,faust_unsigned_int k);
}
#include "faust_prox_gpu.hpp"
#endif
......@@ -6,94 +6,94 @@
#include "algorithm"
#include "faust_gpu2cpu.h"
#include "faust_MatDense.h"
#include "prox.h"
#include "faust_prox.h"
// const char * interface_prox_name="prox : ";
template<typename FPP>
void prox_sp(Faust::MatDense<FPP,Gpu>& cu_M, faust_unsigned_int k)
void Faust::prox_sp(Faust::MatDense<FPP,Gpu>& cu_M, faust_unsigned_int k)
{
Faust::MatDense<FPP,Cpu> M;
faust_gpu2cpu(M, cu_M);
prox_sp(M,k);
Faust::prox_sp(M,k);
cu_M = M;
}
template<typename FPP>
void prox_spcol(Faust::MatDense<FPP,Gpu>& cu_M, faust_unsigned_int k)
void Faust::prox_spcol(Faust::MatDense<FPP,Gpu>& cu_M, faust_unsigned_int k)
{
Faust::MatDense<FPP,Cpu> M;
faust_gpu2cpu(M, cu_M);
prox_spcol(M,k);
Faust::prox_spcol(M,k);
cu_M = M;
}
template<typename FPP>
void prox_splin(Faust::MatDense<FPP,Gpu>& cu_M, faust_unsigned_int k)
void Faust::prox_splin(Faust::MatDense<FPP,Gpu>& cu_M, faust_unsigned_int k)
{
Faust::MatDense<FPP,Cpu> M;
faust_gpu2cpu(M, cu_M);
prox_splin(M,k);
Faust::prox_splin(M,k);
cu_M = M;
}
template<typename FPP>
void prox_normcol(Faust::MatDense<FPP,Gpu>& cu_M, FPP s)
void Faust::prox_normcol(Faust::MatDense<FPP,Gpu>& cu_M, FPP s)
{
Faust::MatDense<FPP,Cpu> M;
faust_gpu2cpu(M, cu_M);
prox_normcol(M,s);
cu_M = M;
Faust::MatDense<FPP,Cpu> M;
faust_gpu2cpu(M, cu_M);
Faust::prox_normcol(M,s);
cu_M = M;
}
template<typename FPP>
void prox_normlin(Faust::MatDense<FPP,Gpu> & cu_M, FPP s)
void Faust::prox_normlin(Faust::MatDense<FPP,Gpu> & cu_M, FPP s)
{
Faust::MatDense<FPP,Cpu> M;
faust_gpu2cpu(M, cu_M);
prox_normlin(M,s);
Faust::prox_normlin(M,s);
cu_M = M;
}
template<typename FPP>
void prox_sp_pos(Faust::MatDense<FPP,Gpu>& cu_M, faust_unsigned_int k)
void Faust::prox_sp_pos(Faust::MatDense<FPP,Gpu>& cu_M, faust_unsigned_int k)
{
Faust::MatDense<FPP,Cpu> M;
faust_gpu2cpu(M, cu_M);
prox_sp_pos(M,k);
Faust::prox_sp_pos(M,k);
cu_M = M;
}
// M needs to be square and k must divide dimension of M
template<typename FPP>
void prox_blkdiag(Faust::MatDense<FPP,Gpu>& cu_M, int k)
void Faust::prox_blkdiag(Faust::MatDense<FPP,Gpu>& cu_M, int k)
{
Faust::MatDense<FPP,Cpu> M;
faust_gpu2cpu(M, cu_M);
prox_blkdiag(M,k);
Faust::prox_blkdiag(M,k);
cu_M = M;
}
template<typename FPP>
void prox_supp(Faust::MatDense<FPP,Gpu>& cu_M, const Faust::MatDense<FPP,Gpu>& cu_supp)
void Faust::prox_supp(Faust::MatDense<FPP,Gpu>& cu_M, const Faust::MatDense<FPP,Gpu>& cu_supp)
{
Faust::MatDense<FPP,Cpu> M,supp;
faust_gpu2cpu(M, cu_M);
faust_gpu2cpu(supp, cu_supp);
prox_supp(M,supp);
Faust::prox_supp(M,supp);
cu_M = M;
}
template<typename FPP>
void prox_splincol(Faust::MatDense<FPP,Gpu>& cu_M, const faust_unsigned_int k)
void Faust::prox_splincol(Faust::MatDense<FPP,Gpu>& cu_M, const faust_unsigned_int k)
{
Faust::MatDense<FPP,Cpu> M,supp;
faust_gpu2cpu(M, cu_M);
prox_splincol(M,k);
Faust::prox_splincol(M,k);
cu_M = M;
}
#endif
......
#ifndef __PROX_GPU_H__
#define __PROX_GPU_H__
#include "faust_MatDense_gpu.h"
#include "faust_constant_gpu.h"
#include "faust_exception.h"
template<typename FPP>
void prox_sp(Faust::MatDense<FPP,Gpu> & M,faust_unsigned_int k);
template<typename FPP>
void prox_sp_pos(Faust::MatDense<FPP,Gpu> & M,faust_unsigned_int k);
template<typename FPP>
void prox_spcol(Faust::MatDense<FPP,Gpu> & M,faust_unsigned_int k);
template<typename FPP>
void prox_splin(Faust::MatDense<FPP,Gpu> & M,faust_unsigned_int k);
template<typename FPP>
void prox_splincol(Faust::MatDense<FPP,Gpu> & M,faust_unsigned_int k);
template<typename FPP>
void prox_normcol(Faust::MatDense<FPP,Gpu> & M,FPP s);
template<typename FPP>
void prox_normlin(Faust::MatDense<FPP,Gpu> & M,FPP s);
template<typename FPP>
void prox_supp(Faust::MatDense<FPP,Gpu> & M, const Faust::MatDense<FPP,Gpu> & supp);
template<typename FPP>
void prox_blkdiag(Faust::MatDense<FPP,Gpu> & M,faust_unsigned_int k);
template<typename FPP>
void prox_splincol(Faust::MatDense<FPP,Gpu> & M,faust_unsigned_int k);
#include "prox_gpu.hpp"
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment