Anyone could help me rewrite this c++ code in cuda?

The code is as follow:
template
typename Spherical_covariance::result_type
Spherical_covariance::
compute(const typename Spherical_covariance::EuclideanVector& vec) const{
double h=euclidean_norm(vec);

if( h >= this->a_ )
return 0;
else
return this->c_ * (1 - 1.5h/this->a_ + 0.5pow(h/this->a_ , 3));
}

template
typename Spherical_covariance::result_type
Spherical_covariance::isotrop_compute(double h) const{
if( h >= this->a_ )
return 0.0;
else
return this->c_ * (1 - 1.5h/this->a_ + 0.5pow(h/this->a_ , 3));
}