#ifndef __GPU_H
#define __GPU_H

#include <stdio.h>
#include <stdlib.h>

#include <cuda.h>
#include <cuda_runtime_api.h>
#include "f2c.h"

#ifdef __cplusplus 	
extern "C" {	
#endif		

__device__
logical lsame_(char *ca, char *cb);

__device__
/* Subroutine */ int xerbla_(char *srname, integer *info);

//__device__
//integer ilaenv_(integer *ispec, char *name__, char *opts, integer *n1, 
//	integer *n2, integer *n3, integer *n4);

__device__
doublereal clanhe_(char *norm, char *uplo, integer *n, complex *a, integer *
	lda, real *work);

__device__
/* Subroutine */ int chetrd_(char *uplo, integer *n, complex *a, integer *lda, 
	 real *d__, real *e, complex *tau, complex *work, integer *lwork, 
	integer *info);

__device__
/* Subroutine */ int cstedc_(char *compz, integer *n, real *d__, real *e, 
	complex *z__, integer *ldz, complex *work, integer *lwork, real *
	rwork, integer *lrwork, integer *iwork, integer *liwork, integer *
	info);

__device__
/* Subroutine */ int cunmtr_(char *side, char *uplo, char *trans, integer *m, 
	integer *n, complex *a, integer *lda, complex *tau, complex *c__, 
	integer *ldc, complex *work, integer *lwork, integer *info);

__device__
/* Subroutine */ int clacpy_(char *uplo, integer *m, integer *n, complex *a, 
	integer *lda, complex *b, integer *ldb);

__device__
/* Subroutine */ int sscal_(integer *n, real *sa, real *sx, integer *incx);

__device__
double c_abs(complex *z);

__device__
double f__cabs(double real, double imag);

__device__
/* Subroutine */ int chetd2_(char *uplo, integer *n, complex *a, integer *lda, 
	 real *d__, real *e, complex *tau, integer *info);

__device__
/* Subroutine */ int clarfg_(integer *n, complex *alpha, complex *x, integer *
	incx, complex *tau);

__device__
/* Subroutine */ int chemv_(char *uplo, integer *n, complex *alpha, complex *
	a, integer *lda, complex *x, integer *incx, complex *beta, complex *y, 
	 integer *incy);

__device__
/* Complex */ VOID cdotc_(complex * ret_val, integer *n, complex *cx, integer 
	*incx, complex *cy, integer *incy);

__device__
/* Subroutine */ int caxpy_(integer *n, complex *ca, complex *cx, integer *
	incx, complex *cy, integer *incy);

__device__
/* Subroutine */ int cher2_(char *uplo, integer *n, complex *alpha, complex *
	x, integer *incx, complex *y, integer *incy, complex *a, integer *lda);

__device__
doublereal scnrm2_(integer *n, complex *x, integer *incx);

__device__
doublereal slapy3_(real *x, real *y, real *z__);

__device__
/* Complex */ VOID cladiv_(complex * ret_val, complex *x, complex *y);


__device__
/* Subroutine */ int cscal_(integer *n, complex *ca, complex *cx, integer *
	incx);

	__device__
double r_imag(complex *z);

__device__
double r_sign(real *a, real *b);

	__device__
VOID r_cnjg(complex *r, complex *z);

__device__
doublereal scabs1_(complex *z__);

__device__
/* Subroutine */ int sladiv_(real *a, real *b, real *c__, real *d__, real *p, 
	real *q);

__device__
void s_copy(register char *a, register char *b, ftnlen la, ftnlen lb);

__device__
integer s_cmp(char *a0, char *b0, ftnlen la, ftnlen lb);

__device__
/* Subroutine */ int claset_(char *uplo, integer *m, integer *n, complex *
	alpha, complex *beta, complex *a, integer *lda);

__device__
doublereal slanst_(char *norm, integer *n, real *d__, real *e);

__device__
/* Subroutine */ int slaev2_(real *a, real *b, real *c__, real *rt1, real *
	rt2, real *cs1, real *sn1);

__device__
/* Subroutine */ int clasr_(char *side, char *pivot, char *direct, integer *m, 
	 integer *n, real *c__, real *s, complex *a, integer *lda);

__device__
/* Subroutine */ int slae2_(real *a, real *b, real *c__, real *rt1, real *rt2);

__device__
doublereal slapy2_(real *x, real *y);

__device__
/* Subroutine */ int slartg_(real *f, real *g, real *cs, real *sn, real *r__);

__device__
/* Subroutine */ int slasrt_(char *id, integer *n, real *d__, integer *info);


__device__
/* Subroutine */ int cswap_(integer *n, complex *cx, integer *incx, complex *
	cy, integer *incy);


__device__
/* Subroutine */ int slassq_(integer *n, real *x, integer *incx, real *scale, 
	real *sumsq);

	__device__
double pow_ri(real *ap, integer *bp);

__device__
logical slaisnan_(real *sin1, real *sin2);

__device__
/* Subroutine */ int cunmqr_(char *side, char *trans, integer *m, integer *n, 
	integer *k, complex *a, integer *lda, complex *tau, complex *c__, 
	integer *ldc, complex *work, integer *lwork, integer *info);

__device__
 VOID
s_cat(char *lp, char *rpp[], ftnint rnp[], ftnint *np, ftnlen ll);

//__device__
// char *
//F77_aloc(integer Len, const char *whence);

__device__
/* Subroutine */ int cunm2r_(char *side, char *trans, integer *m, integer *n, 
	integer *k, complex *a, integer *lda, complex *tau, complex *c__, 
	integer *ldc, complex *work, integer *info);

__device__
/* Subroutine */ int clarf_(char *side, integer *m, integer *n, complex *v, 
	integer *incv, complex *tau, complex *c__, integer *ldc, complex *
	work);

__device__
integer ilaclc_(integer *m, integer *n, complex *a, integer *lda);

__device__
/* Subroutine */ int cgemv_(char *trans, integer *m, integer *n, complex *
	alpha, complex *a, integer *lda, complex *x, integer *incx, complex *
	beta, complex *y, integer *incy);

__device__
/* Subroutine */ int cgerc_(integer *m, integer *n, complex *alpha, complex *
	x, integer *incx, complex *y, integer *incy, complex *a, integer *lda);

	__device__
integer pow_ii(integer *ap, integer *bp);


__device__
/* Subroutine */ int csteqr_(char *compz, integer *n, real *d__, real *e, 
	complex *z__, integer *ldz, real *work, integer *info);



#ifdef __cplusplus
}
#endif


#endif /* __GPU_H */
