17 #ifndef _SUTRA_CONTROLLER_H_
18 #define _SUTRA_CONTROLLER_H_
35 template <
typename Tcomp,
typename Tout>
36 typename std::enable_if<std::is_same<Tcomp, Tout>::value,
void>::type
41 template <
typename Tcomp,
typename Tout>
42 typename std::enable_if<!std::is_same<Tcomp, Tout>::value,
void>::type
47 template <
typename Tcomp,
typename Tout>
86 float delay,
SutraDms *dms,
int *idx_dms,
int ndm,
int *idx_centro,
int ncentro);
104 init_voltage_impl<Tcomp, Tout>(this->d_voltage, this->d_com_clipped);
154 template <typename Tin, typename Tout, std::enable_if_t<std::is_same<Tin, Tout>::value,
bool> =
true>
156 uint16_t val_max,
CarmaDevice *device, cudaStream_t stream){};
158 template <typename Tin, typename Tout, std::enable_if_t<!std::is_same<Tin, Tout>::value,
bool> =
true>
159 void convert_to_voltage(Tin *d_idata, Tout *d_odata,
int N,
float volt_min,
float volt_max,
160 uint16_t val_max,
CarmaDevice *device, cudaStream_t stream);
165 int fill_cmat(
float *cmat,
float *wtt,
float *Mtt,
int nactu,
int nslopes,
167 int do_statmat(
float *statcov,
long dim,
float *xpos,
float *ypos,
float norm,
176 int absnormfft(cuFloatComplex *idata,
float *odata,
int N,
float norm,
this file provides the cublas features to CarmaObj
this class provides the context in which CarmaObj are created
cublasHandle_t get_cublas_handle()
CarmaContext * get_context()
this class provides the controller features to COMPASS
int set_delay(float delay)
CarmaObj< Tcomp > * d_com1
int enable_perturb_voltage(string name)
int add_perturb_voltage(string name, float *perturb, int N)
int set_volt_max(float volt_max)
virtual string get_type()=0
int set_val_max(float val_max)
int reset_perturb_voltage()
cublasHandle_t cublas_handle()
CarmaObj< Tout > * d_voltage
int comp_polc(CarmaObj< Tcomp > &sk, CarmaObj< Tcomp > &iMat, CarmaObj< Tcomp > &ol_meas)
Compute the open loop measurements and effective commands.
CarmaObj< Tcomp > * d_com_padded
int set_centroids_ref(Tcomp *centroids_ref)
CarmaObj< Tcomp > * d_com
int set_com(float *com, int nElem)
virtual int comp_com()=0
!!! YOU MUST set d_centroids before calling it!!!!
CarmaObj< Tcomp > * d_com_clipped
int set_open_loop(int open_loop_status, bool rst=true)
vector< SutraDm * > d_dmseen
CarmaObj< Tcomp > * d_centroids
int set_volt_min(float volt_min)
CarmaContext * current_context
CarmaObj< Tcomp > * d_centroids_padded
int remove_perturb_voltage(string name)
int set_perturb_voltage(string name, float *perturb, int N)
virtual ~SutraController()
SutraController(CarmaContext *context, int nslope, int nactu, float delay, SutraDms *dms, int *idx_dms, int ndm, int *idx_centro, int ncentro)
map< string, tuple< CarmaObj< Tcomp > *, int, bool > > d_perturb_map
int disable_perturb_voltage(string name)
std::deque< CarmaObj< Tcomp > * > d_circular_coms
int fill_cmat(float *cmat, float *wtt, float *Mtt, int nactu, int nslopes, CarmaDevice *device)
void convert_to_voltage(Tin *d_idata, Tout *d_odata, int N, float volt_min, float volt_max, uint16_t val_max, CarmaDevice *device, cudaStream_t stream)
int adjust_csr_index(int *rowind, int *NNZ, int *nact, int nact_tot, int row_off, CarmaDevice *device)
int do_statmat(float *statcov, long dim, float *xpos, float *ypos, float norm, CarmaDevice *device)
int fill_filtmat(float *filter, int nactu, int N, CarmaDevice *device)
int absnormfft(cuFloatComplex *idata, float *odata, int N, float norm, CarmaDevice *device)
std::enable_if< std::is_same< Tcomp, Tout >::value, void >::type init_voltage_impl(CarmaObj< Tout > *&volts, CarmaObj< Tcomp > *comClipped)
int compute_Hcor_gpu(float *o_data, int nrow, int ncol, float Fs, float gmin, float gmax, float delay, CarmaDevice *device)
int get_pupphase(T *odata, float *idata, int *indx_pup, int Nphi, CarmaDevice *device)
int shift_buf(float *d_data, int offset, int N, CarmaDevice *device)
int TT_filt(float *mat, int n, CarmaDevice *device)