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; cudaError_t err;
err = cudaDeviceSynchronize(); err = cudaDeviceSynchronize();
#if 0
if (err == cudaSuccess) if (err == cudaSuccess)
return SPGPU_SUCCESS; return SPGPU_SUCCESS;
else { else {
fprintf(stderr,"CUDA Error cudaSync: %s\n", cudaGetErrorString(err)); fprintf(stderr,"CUDA Error cudaSync: %s\n", cudaGetErrorString(err));
return SPGPU_UNSPECIFIED; return SPGPU_UNSPECIFIED;
} }
#else
if (err != cudaSuccess) {
fprintf(stderr,"CUDA Error cudaSync: %s\n", cudaGetErrorString(err));
}
return ;
#endif
} }
void cudaReset() void cudaReset()
{ {
cudaError_t err; cudaError_t err;
err = cudaDeviceReset(); err = cudaDeviceReset();
#if 0
if (err != cudaSuccess) { if (err != cudaSuccess) {
fprintf(stderr,"CUDA Error Reset: %s\n", cudaGetErrorString(err)); fprintf(stderr,"CUDA Error Reset: %s\n", cudaGetErrorString(err));
return SPGPU_UNSPECIFIED; 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 gpuInit(int dev);
int getDeviceCount(); int getDeviceCount();
int getDevice(); int getDevice();
int getDeviceHasUVA();
int setDevice(int dev); int setDevice(int dev);
int getGPUMultiProcessors(); int getGPUMultiProcessors();
int getGPUMemoryBusWidth(); int getGPUMemoryBusWidth();

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

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

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

Loading…
Cancel
Save