Skip to content

Commit

Permalink
Merge pull request #4 from ashok3t/ashok/nvcc-10.0
Browse files Browse the repository at this point in the history
Fix build errors with nvcc 10.0
  • Loading branch information
cbalint13 authored Jun 14, 2019
2 parents 36cb912 + ab75d28 commit 610a945
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/pba/CuTexImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,9 @@ void CuTexImage::CopyToHost(void * buf)
{
if(_cuData == NULL) return;
size_t sz = _imgWidth * _imgHeight * _numChannel * sizeof(float);
//cudaThreadSynchronize();
//cudaDeviceSynchronize();
cudaMemcpy(buf, _cuData,sz , cudaMemcpyDeviceToHost);
cudaThreadSynchronize();
cudaDeviceSynchronize(); // cudaThreadSynchronize was deprecated in CUDA 10.0
}


Expand Down
7 changes: 3 additions & 4 deletions src/pba/ProgramCU.cu
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
inline void CuTexImage:: BindTexture(textureReference& texRef)
{
size_t sz = GetDataSize();
if(sz > MAX_TEXSIZE) fprintf(stderr, "cudaBindTexture: %d > %d\n", sz , MAX_TEXSIZE);
if(sz > MAX_TEXSIZE) fprintf(stderr, "cudaBindTexture: %ld > %d\n", sz , MAX_TEXSIZE);
cudaError_t e =cudaBindTexture(NULL, &texRef, data(), &texRef.channelDesc, sz);
}

Expand Down Expand Up @@ -117,7 +117,7 @@ inline int CuTexImage::BindTextureX(textureReference& texRef1, textureReference&
//////////////////////////////////////////////////////
void ProgramCU::FinishWorkCUDA()
{
cudaThreadSynchronize();
cudaDeviceSynchronize();
}

int ProgramCU::CheckErrorCUDA(const char* location)
Expand All @@ -128,7 +128,6 @@ int ProgramCU::CheckErrorCUDA(const char* location)
if(location) fprintf(stderr, "%s:\t", location);
fprintf(stderr, "%s(%d)\n", cudaGetErrorString(e), e);
throw location;
return 1;
}else
{
//fprintf(stderr, "%s:\n", location);
Expand Down Expand Up @@ -2196,7 +2195,7 @@ bool ProgramCU::ShuffleCameraJacobian(CuTexImage& jc, CuTexImage& map, CuTexImag

if(szjc > 2 * MAX_TEXSIZE)
{
fprintf(stderr, "datasize way too big %d, %d+...\n", szjc, (szjc)/ MAX_TEXSIZE);
fprintf(stderr, "datasize way too big %ld, %ld+...\n", szjc, (szjc)/ MAX_TEXSIZE);
return false;
}else if(szjc > MAX_TEXSIZE)
{
Expand Down
10 changes: 5 additions & 5 deletions src/pba/SparseBundleCU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ if(__debug_pba && v.IsValid()){\
#define DEBUG_FUNC(v, func, input) DEBUG_FUNCN(v, func, input, 2)


SparseBundleCU::SparseBundleCU(int device) : ParallelBA(PBA_INVALID_DEVICE),
_num_camera(0), _num_point(0), _num_imgpt(0), _num_imgpt_q(0),
_camera_data(NULL), _point_data(NULL), _imgpt_data(NULL),
_camera_idx(NULL), _point_idx(NULL), _projection_sse(0)
SparseBundleCU::SparseBundleCU(int device) : ParallelBA(PBA_INVALID_DEVICE),
_num_camera(0), _num_point(0), _num_imgpt(0), _camera_data(NULL),
_point_data(NULL), _imgpt_data(NULL), _camera_idx(NULL),
_point_idx(NULL), _projection_sse(0), _num_imgpt_q(0)
{
__selected_device = device;
}
Expand Down Expand Up @@ -280,7 +280,7 @@ bool SparseBundleCU::CheckRequiredMem(int fresh)
int p = 8 * m + 4 * n, q = _num_imgpt_q;
size_t szn, total = GetCudaMemoryCap();
size_t sz0 = 800*600*2*4*sizeof(float); //
size_t szq = q > 0 ? (sizeof(float) *(q + m) * 4) : 0;
//size_t szq = q > 0 ? (sizeof(float) *(q + m) * 4) : 0;
size_t sz = sizeof(float) * (258 + 9 * n + 33 * m + 7 * k) + sz0;

/////////////////////////////////// CG
Expand Down

0 comments on commit 610a945

Please sign in to comment.