Skip to content

Commit

Permalink
edit: fix cuda compile error on linux (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
HPDell authored Oct 6, 2023
1 parent f82ad05 commit 673df0c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions include/gwmodelpp/utils/cumat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,8 @@ template<class T>
class cuview
{
public:
constexpr static cubase::Type type = custride<T>::type;
constexpr static cuop::Op op = custride<T>::op;
constexpr static cubase::Type type = cutraits<T>::type;
constexpr static cuop::Op op = cutraits<T>::op;

public:
explicit cuview(T& src): mSrc(src) {}
Expand Down
6 changes: 4 additions & 2 deletions src/gwmodelpp/GWRBasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,8 @@ arma::mat GWRBasic::predictCuda(const mat& locations, const mat& x, const vec& y

double GWRBasic::bandwidthSizeCriterionCVCuda(BandwidthWeight* bandwidthWeight)
{
uword nDp = mCoords.n_rows, nVar = mX.n_cols, elems = nDp;
uword nDp = mCoords.n_rows, nVar = mX.n_cols;
size_t elems = nDp;
cumat u_xt(mX.t()), u_y(mY);
cumat u_dists(nDp, 1), u_weights(nDp, 1);
custride u_xtw(nVar, nDp, mGroupLength);
Expand Down Expand Up @@ -759,7 +760,8 @@ double GWRBasic::bandwidthSizeCriterionCVCuda(BandwidthWeight* bandwidthWeight)

double GWRBasic::bandwidthSizeCriterionAICCuda(BandwidthWeight* bandwidthWeight)
{
uword nDp = mCoords.n_rows, nVar = mX.n_cols, elems = nDp;
uword nDp = mCoords.n_rows, nVar = mX.n_cols;
size_t elems = nDp;
cumat u_xt(mX.t()), u_y(mY), u_betas(nVar, nDp);
cumat u_dists(nDp, 1), u_weights(nDp, 1);
custride u_xtw(nVar, nDp, mGroupLength);
Expand Down
12 changes: 8 additions & 4 deletions src/gwmodelpp/GWRMultiscale.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,8 @@ vec GWRMultiscale::fitVarCuda(const vec &x, const vec &y, const uword var, mat &

double GWRMultiscale::bandwidthSizeCriterionAllCVCuda(BandwidthWeight* bandwidthWeight)
{
uword nDp = mCoords.n_rows, nVar = mX.n_cols, elems = nDp;
uword nDp = mCoords.n_rows, nVar = mX.n_cols;
size_t elems = nDp;
cumat u_xt(mX.t()), u_y(mY);
cumat u_dists(nDp, 1), u_weights(nDp, 1);
custride u_xtw(nVar, nDp, mGroupLength);
Expand Down Expand Up @@ -1198,7 +1199,8 @@ double GWRMultiscale::bandwidthSizeCriterionAllCVCuda(BandwidthWeight* bandwidth

double GWRMultiscale::bandwidthSizeCriterionAllAICCuda(BandwidthWeight* bandwidthWeight)
{
uword nDp = mCoords.n_rows, nVar = mX.n_cols, elems = nDp;
uword nDp = mCoords.n_rows, nVar = mX.n_cols;
size_t elems = nDp;
cumat u_xt(mX.t()), u_y(mY), u_betas(nVar, nDp);
cumat u_dists(nDp, 1), u_weights(nDp, 1);
custride u_xtw(nVar, nDp, mGroupLength);
Expand Down Expand Up @@ -1263,7 +1265,8 @@ double GWRMultiscale::bandwidthSizeCriterionAllAICCuda(BandwidthWeight* bandwidt
double GWRMultiscale::bandwidthSizeCriterionVarCVCuda(BandwidthWeight* bandwidthWeight)
{
size_t var = mBandwidthSelectionCurrentIndex;
uword nDp = mCoords.n_rows, elems = nDp;
uword nDp = mCoords.n_rows;
size_t elems = nDp;
constexpr size_t nVar = 1;
cumat u_xt(mXi.t()), u_y(mYi);
cumat u_dists(nDp, 1), u_weights(nDp, 1);
Expand Down Expand Up @@ -1323,7 +1326,8 @@ double GWRMultiscale::bandwidthSizeCriterionVarCVCuda(BandwidthWeight* bandwidth
double GWRMultiscale::bandwidthSizeCriterionVarAICCuda(BandwidthWeight* bandwidthWeight)
{
size_t var = mBandwidthSelectionCurrentIndex;
uword nDp = mCoords.n_rows, elems = nDp;
uword nDp = mCoords.n_rows;
size_t elems = nDp;
constexpr size_t nVar = 1;
cumat u_xt(mXi.t()), u_y(mYi), u_betas(nVar, nDp);
cumat u_dists(nDp, 1), u_weights(nDp, 1);
Expand Down

0 comments on commit 673df0c

Please sign in to comment.