Fix C function declarations for compilation with LLVM/clang in CUDA

repack-llvm
sfilippone 9 months ago
parent 4347c663c2
commit 0760e4d553

@ -378,22 +378,36 @@ void cudaSync()
{
cudaError_t err;
err = cudaDeviceSynchronize();
#if 0
if (err == cudaSuccess)
return SPGPU_SUCCESS;
else {
fprintf(stderr,"CUDA Error cudaSync: %s\n", cudaGetErrorString(err));
return SPGPU_UNSPECIFIED;
}
#else
if (err != cudaSuccess) {
fprintf(stderr,"CUDA Error cudaSync: %s\n", cudaGetErrorString(err));
}
return ;
#endif
}
void cudaReset()
{
cudaError_t err;
err = cudaDeviceReset();
#if 0
if (err != cudaSuccess) {
fprintf(stderr,"CUDA Error Reset: %s\n", cudaGetErrorString(err));
return SPGPU_UNSPECIFIED;
}
#else
if (err != cudaSuccess) {
fprintf(stderr,"CUDA Error Reset: %s\n", cudaGetErrorString(err));
}
return ;
#endif
}

@ -54,6 +54,7 @@ int freeRemoteBuffer(void* buffer);
int gpuInit(int dev);
int getDeviceCount();
int getDevice();
int getDeviceHasUVA();
int setDevice(int dev);
int getGPUMultiProcessors();
int getGPUMemoryBusWidth();

@ -112,7 +112,7 @@ void zeroEllDevice(void *remoteMatrix)
else if (tmp->dataType == SPGPU_TYPE_COMPLEX_DOUBLE)
cudaMemset((void *)tmp->cM, 0, tmp->allocsize*sizeof(cuDoubleComplex));
else
return SPGPU_UNSUPPORTED; // Unsupported params
return ; // Unsupported params
//fprintf(stderr,"From allocEllDevice: %d %d %d %p %p %p\n",tmp->maxRowSize,
// tmp->avgRowSize,tmp->allocsize,tmp->rS,tmp->rP,tmp->cM);

@ -95,6 +95,7 @@ typedef struct EllDeviceParams
unsigned int firstIndex;
} EllDeviceParams;
int computeEllAllocPitch(int rowsCount);
int FallocEllDevice(void** deviceMat, unsigned int rows, unsigned int maxRowSize,
unsigned int nnzeros,
unsigned int columns, unsigned int elementType,

@ -320,7 +320,7 @@ int T_spsvCSRGDevice(T_Cmat *Matrix, TYPE alpha, void *deviceX,
}
#if CUDA_VERSION >= 11030
T_CSRGCreateSpMVDescr(T_CSRGDeviceMat *cMat)
int T_CSRGCreateSpMVDescr(T_CSRGDeviceMat *cMat)
{
int64_t tr,tc,tz;
tr = cMat->m;

Loading…
Cancel
Save