From 3cc3de7f681c2d8c4c604dac40e92d3e7356d5c7 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 16 Apr 2014 11:13:52 +0000 Subject: Remove duplicate unused code --- cuda/2d/arith.cu | 299 ++----------------------------------------------------- cuda/2d/arith.h | 17 ---- cuda/2d/dims.h | 9 -- 3 files changed, 7 insertions(+), 318 deletions(-) (limited to 'cuda/2d') diff --git a/cuda/2d/arith.cu b/cuda/2d/arith.cu index 9544026..04d4de9 100644 --- a/cuda/2d/arith.cu +++ b/cuda/2d/arith.cu @@ -619,277 +619,6 @@ void processSino(float* out, const float* in1, const float* in2, float param, un -template -void processVol3D(cudaPitchedPtr& out, const SDimensions3D& dims) -{ - dim3 blockSize(16,16); - dim3 gridSize((dims.iVolX+15)/16, (dims.iVolY+511)/512); - float *pfOut = (float*)out.ptr; - unsigned int step = out.pitch/sizeof(float) * dims.iVolY; - - for (unsigned int i = 0; i < dims.iVolZ; ++i) { - devtoD<<>>(pfOut, out.pitch/sizeof(float), dims.iVolX, dims.iVolY); - pfOut += step; - } - - cudaTextForceKernelsCompletion(); -} - -template -void processVol3D(cudaPitchedPtr& out, float fParam, const SDimensions3D& dims) -{ - dim3 blockSize(16,16); - dim3 gridSize((dims.iVolX+15)/16, (dims.iVolY+511)/512); - float *pfOut = (float*)out.ptr; - unsigned int step = out.pitch/sizeof(float) * dims.iVolY; - - for (unsigned int i = 0; i < dims.iVolZ; ++i) { - devFtoD<<>>(pfOut, fParam, out.pitch/sizeof(float), dims.iVolX, dims.iVolY); - pfOut += step; - } - - cudaTextForceKernelsCompletion(); -} - -template -void processVol3D(cudaPitchedPtr& out1, cudaPitchedPtr& out2, float fParam1, float fParam2, const SDimensions3D& dims) -{ - dim3 blockSize(16,16); - dim3 gridSize((dims.iVolX+15)/16, (dims.iVolY+511)/512); - float *pfOut1 = (float*)out1.ptr; - float *pfOut2 = (float*)out2.ptr; - unsigned int step = out1.pitch/sizeof(float) * dims.iVolY; - - for (unsigned int i = 0; i < dims.iVolZ; ++i) { - devFFtoDD<<>>(pfOut1, pfOut2, fParam1, fParam2, out1.pitch/sizeof(float), dims.iVolX, dims.iVolY); - pfOut1 += step; - pfOut2 += step; - } - - cudaTextForceKernelsCompletion(); -} - - -template -void processVol3D(cudaPitchedPtr& out, const cudaPitchedPtr& in, const SDimensions3D& dims) -{ - dim3 blockSize(16,16); - dim3 gridSize((dims.iVolX+15)/16, (dims.iVolY+511)/512); - float *pfOut = (float*)out.ptr; - float *pfIn = (float*)in.ptr; - unsigned int step = out.pitch/sizeof(float) * dims.iVolY; - - for (unsigned int i = 0; i < dims.iVolZ; ++i) { - devDtoD<<>>(pfOut, pfIn, out.pitch/sizeof(float), dims.iVolX, dims.iVolY); - pfOut += step; - pfIn += step; - } - - cudaTextForceKernelsCompletion(); -} - -template -void processVol3D(cudaPitchedPtr& out, const cudaPitchedPtr& in, float fParam, const SDimensions3D& dims) -{ - dim3 blockSize(16,16); - dim3 gridSize((dims.iVolX+15)/16, (dims.iVolY+511)/512); - float *pfOut = (float*)out.ptr; - float *pfIn = (float*)in.ptr; - unsigned int step = out.pitch/sizeof(float) * dims.iVolY; - - for (unsigned int i = 0; i < dims.iVolZ; ++i) { - devDFtoD<<>>(pfOut, pfIn, fParam, out.pitch/sizeof(float), dims.iVolX, dims.iVolY); - pfOut += step; - pfIn += step; - } - - cudaTextForceKernelsCompletion(); -} - -template -void processVol3D(cudaPitchedPtr& out, const cudaPitchedPtr& in1, const cudaPitchedPtr& in2, float fParam, const SDimensions3D& dims) -{ - dim3 blockSize(16,16); - dim3 gridSize((dims.iVolX+15)/16, (dims.iVolY+511)/512); - float *pfOut = (float*)out.ptr; - float *pfIn1 = (float*)in1.ptr; - float *pfIn2 = (float*)in2.ptr; - unsigned int step = out.pitch/sizeof(float) * dims.iVolY; - - for (unsigned int i = 0; i < dims.iVolZ; ++i) { - devDDFtoD<<>>(pfOut, pfIn1, pfIn2, fParam, out.pitch/sizeof(float), dims.iVolX, dims.iVolY); - pfOut += step; - pfIn1 += step; - pfIn2 += step; - } - - cudaTextForceKernelsCompletion(); -} - -template -void processVol3D(cudaPitchedPtr& out, const cudaPitchedPtr& in1, const cudaPitchedPtr& in2, const SDimensions3D& dims) -{ - dim3 blockSize(16,16); - dim3 gridSize((dims.iVolX+15)/16, (dims.iVolY+511)/512); - float *pfOut = (float*)out.ptr; - float *pfIn1 = (float*)in1.ptr; - float *pfIn2 = (float*)in2.ptr; - unsigned int step = out.pitch/sizeof(float) * dims.iVolY; - - for (unsigned int i = 0; i < dims.iVolZ; ++i) { - devDDtoD<<>>(pfOut, pfIn1, pfIn2, out.pitch/sizeof(float), dims.iVolX, dims.iVolY); - pfOut += step; - pfIn1 += step; - pfIn2 += step; - } - - cudaTextForceKernelsCompletion(); -} - - - - - - - - - - - - - -template -void processSino3D(cudaPitchedPtr& out, const SDimensions3D& dims) -{ - dim3 blockSize(16,16); - dim3 gridSize((dims.iProjU+15)/16, (dims.iProjAngles+511)/512); - float *pfOut = (float*)out.ptr; - unsigned int step = out.pitch/sizeof(float) * dims.iProjAngles; - - for (unsigned int i = 0; i < dims.iProjV; ++i) { - devtoD<<>>(pfOut, out.pitch/sizeof(float), dims.iProjU, dims.iProjAngles); - pfOut += step; - } - - cudaTextForceKernelsCompletion(); -} - -template -void processSino3D(cudaPitchedPtr& out, float fParam, const SDimensions3D& dims) -{ - dim3 blockSize(16,16); - dim3 gridSize((dims.iProjU+15)/16, (dims.iProjAngles+511)/512); - float *pfOut = (float*)out.ptr; - unsigned int step = out.pitch/sizeof(float) * dims.iProjAngles; - - for (unsigned int i = 0; i < dims.iProjV; ++i) { - devFtoD<<>>(pfOut, fParam, out.pitch/sizeof(float), dims.iProjU, dims.iProjAngles); - pfOut += step; - } - - cudaTextForceKernelsCompletion(); -} - -template -void processSino3D(cudaPitchedPtr& out1, cudaPitchedPtr& out2, float fParam1, float fParam2, const SDimensions3D& dims) -{ - dim3 blockSize(16,16); - dim3 gridSize((dims.iProjU+15)/16, (dims.iProjAngles+511)/512); - float *pfOut1 = (float*)out1.ptr; - float *pfOut2 = (float*)out2.ptr; - unsigned int step = out1.pitch/sizeof(float) * dims.iProjAngles; - - for (unsigned int i = 0; i < dims.iProjV; ++i) { - devFFtoDD<<>>(pfOut1, pfOut2, fParam1, fParam2, out1.pitch/sizeof(float), dims.iProjU, dims.iProjAngles); - pfOut1 += step; - pfOut2 += step; - } - - cudaTextForceKernelsCompletion(); -} - - -template -void processSino3D(cudaPitchedPtr& out, const cudaPitchedPtr& in, const SDimensions3D& dims) -{ - dim3 blockSize(16,16); - dim3 gridSize((dims.iProjU+15)/16, (dims.iProjAngles+511)/512); - float *pfOut = (float*)out.ptr; - float *pfIn = (float*)in.ptr; - unsigned int step = out.pitch/sizeof(float) * dims.iProjAngles; - - for (unsigned int i = 0; i < dims.iProjV; ++i) { - devDtoD<<>>(pfOut, pfIn, out.pitch/sizeof(float), dims.iProjU, dims.iProjAngles); - pfOut += step; - pfIn += step; - } - - cudaTextForceKernelsCompletion(); -} - -template -void processSino3D(cudaPitchedPtr& out, const cudaPitchedPtr& in, float fParam, const SDimensions3D& dims) -{ - dim3 blockSize(16,16); - dim3 gridSize((dims.iProjU+15)/16, (dims.iProjAngles+511)/512); - float *pfOut = (float*)out.ptr; - float *pfIn = (float*)in.ptr; - unsigned int step = out.pitch/sizeof(float) * dims.iProjAngles; - - for (unsigned int i = 0; i < dims.iProjV; ++i) { - devDFtoD<<>>(pfOut, pfIn, fParam, out.pitch/sizeof(float), dims.iProjU, dims.iProjAngles); - pfOut += step; - pfIn += step; - } - - cudaTextForceKernelsCompletion(); -} - -template -void processSino3D(cudaPitchedPtr& out, const cudaPitchedPtr& in1, const cudaPitchedPtr& in2, float fParam, const SDimensions3D& dims) -{ - dim3 blockSize(16,16); - dim3 gridSize((dims.iProjU+15)/16, (dims.iProjAngles+511)/512); - float *pfOut = (float*)out.ptr; - float *pfIn1 = (float*)in1.ptr; - float *pfIn2 = (float*)in2.ptr; - unsigned int step = out.pitch/sizeof(float) * dims.iProjAngles; - - for (unsigned int i = 0; i < dims.iProjV; ++i) { - devDDFtoD<<>>(pfOut, pfIn1, pfIn2, fParam, out.pitch/sizeof(float), dims.iProjU, dims.iProjAngles); - pfOut += step; - pfIn1 += step; - pfIn2 += step; - } - - cudaTextForceKernelsCompletion(); -} - -template -void processSino3D(cudaPitchedPtr& out, const cudaPitchedPtr& in1, const cudaPitchedPtr& in2, const SDimensions3D& dims) -{ - dim3 blockSize(16,16); - dim3 gridSize((dims.iProjU+15)/16, (dims.iProjAngles+511)/512); - float *pfOut = (float*)out.ptr; - float *pfIn1 = (float*)in1.ptr; - float *pfIn2 = (float*)in2.ptr; - unsigned int step = out.pitch/sizeof(float) * dims.iProjAngles; - - for (unsigned int i = 0; i < dims.iProjV; ++i) { - devDDtoD<<>>(pfOut, pfIn1, pfIn2, out.pitch/sizeof(float), dims.iProjU, dims.iProjAngles); - pfOut += step; - pfIn1 += step; - pfIn2 += step; - } - - cudaTextForceKernelsCompletion(); -} - - - - - - @@ -905,52 +634,38 @@ void processSino3D(cudaPitchedPtr& out, const cudaPitchedPtr& in1, const cudaPit #define INST_DFtoD(name) \ template void processVolCopy(float* out, const float* in, float param, const SDimensions& dims); \ template void processVol(float* out, const float* in, float param, unsigned int pitch, const SDimensions& dims); \ - template void processSino(float* out, const float* in, float param, unsigned int pitch, const SDimensions& dims); \ - template void processVol3D(cudaPitchedPtr& out, const cudaPitchedPtr& in, float fParam, const SDimensions3D& dims); \ - template void processSino3D(cudaPitchedPtr& out, const cudaPitchedPtr& in, float fParam, const SDimensions3D& dims); + template void processSino(float* out, const float* in, float param, unsigned int pitch, const SDimensions& dims); #define INST_DtoD(name) \ template void processVolCopy(float* out, const float* in, const SDimensions& dims); \ template void processVol(float* out, const float* in, unsigned int pitch, const SDimensions& dims); \ - template void processSino(float* out, const float* in, unsigned int pitch, const SDimensions& dims); \ - template void processVol3D(cudaPitchedPtr& out, const cudaPitchedPtr& in, const SDimensions3D& dims); \ - template void processSino3D(cudaPitchedPtr& out, const cudaPitchedPtr& in, const SDimensions3D& dims); + template void processSino(float* out, const float* in, unsigned int pitch, const SDimensions& dims); #define INST_DDtoD(name) \ template void processVolCopy(float* out, const float* in1, const float* in2, const SDimensions& dims); \ template void processVol(float* out, const float* in1, const float* in2, unsigned int pitch, const SDimensions& dims); \ - template void processSino(float* out, const float* in1, const float* in2, unsigned int pitch, const SDimensions& dims); \ - template void processVol3D(cudaPitchedPtr& out, const cudaPitchedPtr& in1, const cudaPitchedPtr& in2, const SDimensions3D& dims); \ - template void processSino3D(cudaPitchedPtr& out, const cudaPitchedPtr& in1, const cudaPitchedPtr& in2, const SDimensions3D& dims); + template void processSino(float* out, const float* in1, const float* in2, unsigned int pitch, const SDimensions& dims); #define INST_DDFtoD(name) \ template void processVolCopy(float* out, const float* in1, const float* in2, float fParam, const SDimensions& dims); \ template void processVol(float* out, const float* in1, const float* in2, float fParam, unsigned int pitch, const SDimensions& dims); \ - template void processSino(float* out, const float* in1, const float* in2, float fParam, unsigned int pitch, const SDimensions& dims); \ - template void processVol3D(cudaPitchedPtr& out, const cudaPitchedPtr& in1, const cudaPitchedPtr& in2, float fParam, const SDimensions3D& dims); \ - template void processSino3D(cudaPitchedPtr& out, const cudaPitchedPtr& in1, const cudaPitchedPtr& in2, float fParam, const SDimensions3D& dims); + template void processSino(float* out, const float* in1, const float* in2, float fParam, unsigned int pitch, const SDimensions& dims); #define INST_toD(name) \ template void processVolCopy(float* out, const SDimensions& dims); \ template void processVol(float* out, unsigned int pitch, const SDimensions& dims); \ - template void processSino(float* out, unsigned int pitch, const SDimensions& dims); \ - template void processVol3D(cudaPitchedPtr& out, const SDimensions3D& dims); \ - template void processSino3D(cudaPitchedPtr& out, const SDimensions3D& dims); + template void processSino(float* out, unsigned int pitch, const SDimensions& dims); #define INST_FtoD(name) \ template void processVolCopy(float* out, float param, const SDimensions& dims); \ template void processVol(float* out, float param, unsigned int pitch, const SDimensions& dims); \ - template void processSino(float* out, float param, unsigned int pitch, const SDimensions& dims); \ - template void processVol3D(cudaPitchedPtr& out, float param, const SDimensions3D& dims); \ - template void processSino3D(cudaPitchedPtr& out, float param, const SDimensions3D& dims); + template void processSino(float* out, float param, unsigned int pitch, const SDimensions& dims); #define INST_FFtoDD(name) \ template void processVolCopy(float* out1, float* out2, float fParam1, float fParam2, const SDimensions& dims); \ template void processVol(float* out1, float* out2, float fParam1, float fParam2, unsigned int pitch, const SDimensions& dims); \ - template void processSino(float* out1, float* out2, float fParam1, float fParam2, unsigned int pitch, const SDimensions& dims); \ - template void processVol3D(cudaPitchedPtr& out1, cudaPitchedPtr& out2, float fParam1, float fParam2, const SDimensions3D& dims); \ - template void processSino3D(cudaPitchedPtr& out1, cudaPitchedPtr& out2, float fParam1, float fParam2, const SDimensions3D& dims); + template void processSino(float* out1, float* out2, float fParam1, float fParam2, unsigned int pitch, const SDimensions& dims); diff --git a/cuda/2d/arith.h b/cuda/2d/arith.h index c32a63a..f730e2f 100644 --- a/cuda/2d/arith.h +++ b/cuda/2d/arith.h @@ -79,23 +79,6 @@ template void processSino(float* out, const float* in, float fParam template void processSino(float* out, const float* in1, const float* in2, float fParam, unsigned int pitch, const SDimensions& dims); template void processSino(float* out, const float* in1, const float* in2, unsigned int pitch, const SDimensions& dims); -template void processVol3D(cudaPitchedPtr& out, const SDimensions3D& dims); -template void processVol3D(cudaPitchedPtr& out, float fParam, const SDimensions3D& dims); -template void processVol3D(cudaPitchedPtr& out1, cudaPitchedPtr& out2, float fParam1, float fParam2, const SDimensions3D& dims); -template void processVol3D(cudaPitchedPtr& out, const cudaPitchedPtr& in, const SDimensions3D& dims); -template void processVol3D(cudaPitchedPtr& out, const cudaPitchedPtr& in, float fParam, const SDimensions3D& dims); -template void processVol3D(cudaPitchedPtr& out, const cudaPitchedPtr& in1, const cudaPitchedPtr& in2, float fParam, const SDimensions3D& dims); -template void processVol3D(cudaPitchedPtr& out, const cudaPitchedPtr& in1, const cudaPitchedPtr& in2, const SDimensions3D& dims); - -template void processSino3D(cudaPitchedPtr& out, const SDimensions3D& dims); -template void processSino3D(cudaPitchedPtr& out, float fParam, const SDimensions3D& dims); -template void processSino3D(cudaPitchedPtr& out1, cudaPitchedPtr& out2, float fParam1, float fParam2, const SDimensions3D& dims); -template void processSino3D(cudaPitchedPtr& out, const cudaPitchedPtr& in, const SDimensions3D& dims); -template void processSino3D(cudaPitchedPtr& out, const cudaPitchedPtr& in, float fParam, const SDimensions3D& dims); -template void processSino3D(cudaPitchedPtr& out, const cudaPitchedPtr& in1, const cudaPitchedPtr& in2, float fParam, const SDimensions3D& dims); -template void processSino3D(cudaPitchedPtr& out, const cudaPitchedPtr& in1, const cudaPitchedPtr& in2, const SDimensions3D& dims); - - } diff --git a/cuda/2d/dims.h b/cuda/2d/dims.h index 21ccb31..df349f7 100644 --- a/cuda/2d/dims.h +++ b/cuda/2d/dims.h @@ -53,15 +53,6 @@ struct SDimensions { unsigned int iRaysPerPixelDim; }; -struct SDimensions3D { - unsigned int iVolX; - unsigned int iVolY; - unsigned int iVolZ; - unsigned int iProjAngles; - unsigned int iProjU; // number of detectors in the U direction - unsigned int iProjV; // number of detectors in the V direction -}; - } #endif -- cgit v1.2.3