Mentions légales du service

Skip to content
Snippets Groups Projects
Commit bec3943e authored by hhakim's avatar hhakim
Browse files

Add unimplemented GPU2 TransformHelperButterfly and undo 23347c5e.

The goal is only to compile generic code.
parent 4a1b8651
No related branches found
No related tags found
No related merge requests found
#ifndef __FAUST_TRANSFORM_HELPER_DFT_GPU2__
#define __FAUST_TRANSFORM_HELPER_DFT_GPU2__
#include "faust_TransformHelper_gpu.h"
namespace Faust
{
template<typename FPP, FDevice DEV>
class TransformHelperButterfly;
template<typename FPP>
class ButterflyMat;
template<typename FPP>
class TransformHelperButterfly<FPP, GPU2> : public TransformHelper<FPP, GPU2>
{
// using VecMap = Eigen::Map<Eigen::Matrix<FPP, Eigen::Dynamic, 1>>;
// using DiagMat = Eigen::DiagonalMatrix<FPP, Eigen::Dynamic>;
// FPP *perm_d_ptr;
// DiagMat D;
// std::vector<unsigned int> bitrev_perm;
// std::vector<ButterflyMat<FPP>> opt_factors;
//
//
// // private ctor
// TransformHelperButterfly<FPP, GPU2>(const std::vector<MatGeneric<FPP,GPU2> *>& facts, const FPP lambda_ = (FPP)1.0, const bool optimizedCopy=false, const bool cloning_fact = true, const bool internal_call=false);
//
public:
static TransformHelperButterfly<FPP,GPU2>* fourierFaust(unsigned int n, const bool norma=true) { throw std::runtime_error("Not yet implemented on GPU");};
// Vect<FPP, GPU2> multiply(const Vect<FPP, GPU2>& x);
// void multiply(const FPP* x, FPP* y);
// Vect<FPP,GPU2> multiply(const FPP* x);
// void multiply(const FPP* A, int A_ncols, FPP* C);
// MatDense<FPP, GPU2> multiply(const MatDense<FPP,GPU2> &A);
// MatDense<FPP, GPU2> multiply(const MatSparse<FPP,GPU2> &A);
};
}
//#include "faust_TransformHelperButterfly_gpu.hpp" //TODO
#endif
......@@ -43,6 +43,9 @@
/****************************************************************************/
#include "faust_Transform.h"
#if USE_GPU_MOD
#include "faust_TransformHelperButterfly_gpu.h"
#endif
#include "faust_TransformHelperButterfly.h"
#include <iostream>
#include <exception>
......@@ -142,6 +145,18 @@ FaustCoreCpp<FPP,DEV>* FaustCoreCpp<FPP,DEV>::mul_scal(FPP scal)
}
template<typename FPP, FDevice DEV>
FaustCoreCpp<FPP, DEV>* FaustCoreCpp<FPP, DEV>::fourierFaust(unsigned int n, const bool norma, const bool diag_opt)
{
Faust::TransformHelper<FPP, DEV>* th;
if(diag_opt)
th = Faust::TransformHelperButterfly<FPP,DEV>::fourierFaust(n, norma);
else
th = Faust::TransformHelper<FPP,DEV>::fourierFaust(n, norma);
if(!th) return NULL;
FaustCoreCpp<FPP,DEV>* core = new FaustCoreCpp<FPP,DEV>(th);
return core;
}
template<typename FPP, FDevice DEV>
......
......@@ -137,16 +137,3 @@ FaustCoreCpp<@TYPE@,Cpu>* FaustCoreCpp<@TYPE@,Cpu>::read_from_mat_file(const cha
}
return core;
}
template<>
FaustCoreCpp<@TYPE@, Cpu>* FaustCoreCpp<@TYPE@,Cpu>::fourierFaust(unsigned int n, const bool norma, const bool diag_opt)
{
Faust::TransformHelper<@TYPE@,Cpu>* th;
if(diag_opt)
th = Faust::TransformHelperButterfly<@TYPE@,Cpu>::fourierFaust(n, norma);
else
th = Faust::TransformHelper<@TYPE@,Cpu>::fourierFaust(n, norma);
if(!th) return NULL;
FaustCoreCpp<@TYPE@,Cpu>* core = new FaustCoreCpp<@TYPE@,Cpu>(th);
return core;
}
......@@ -104,16 +104,3 @@ FaustCoreCpp<@TYPE@,GPU2>* FaustCoreCpp<@TYPE@,GPU2>::read_from_mat_file(const c
throw std::runtime_error("A .mat file is always read from CPU code not GPU's.");
return nullptr;
}
template<>
FaustCoreCpp<@TYPE@, GPU2>* FaustCoreCpp<@TYPE@,GPU2>::fourierFaust(unsigned int n, const bool norma, const bool diag_opt)
{
Faust::TransformHelper<@TYPE@,GPU2>* th;
if(diag_opt)
throw std::runtime_error("Diagonal Optimization of DFT isn't yet supported on GPU.");
else
th = Faust::TransformHelper<@TYPE@,GPU2>::fourierFaust(n, norma);
if(!th) return NULL;
FaustCoreCpp<@TYPE@,GPU2>* core = new FaustCoreCpp<@TYPE@,GPU2>(th);
return core;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment