Trying to get Median Filtering Have some questions. Also asking about quicksort and recursion

From what I have found out cuda haven’t created a Median Filtering yet so I’ve decided to make one of my own.

However I am running into a problem.

It ended up taking too much time sorting thought the array and I needed a really fast sorting algorithm.

I’ve found out about quicksort and tried to implemented it myself, but I’m getting this error with trying to create a recursion.

Do anyone know what to do for this?

__device__ void 

	quickSort(char * arrayToSort, int left, int right)

{

	int i = left, int j = right;

	int tmp;

	int pivot = arrayToSort[(left+right / 2)];

	while(i <= j){

		while (arrayToSort[i] < pivot)

			i++;

		while (arrayToSort[j] > pivot)

			if(i <= j)

			{

				tmp = arrayToSort[i];

				arrayToSort[i] = arrayToSort[j];

				arrayToSort[j] = tmp;

				++i;

				++j;

			}

	};

//	recursion

	if(left < j)

		quickSort(arrayToSort,left, j);

	if(i < right)

		quickSort(arrayToSort, i, right);

}

Error 7 error MSB3721: The command ““C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.1\bin\nvcc.exe” -gencode=arch=compute_10,code=“sm_10,compute_10” -gencode=arch=compute_20,code=“sm_20,compute_20” -gencode=arch=compute_10,code=“sm_10,compute_10” -gencode=arch=compute_20,code=“sm_20,compute_20” --use-local-env --cl-version 2010 -ccbin “c:\Program Files\Microsoft Visual Studio 10.0\VC\bin” -I”./" -I"…/…/common/inc" -I"…/…/…/shared/inc" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.1\include" -G0 --keep-dir “Debug” -maxrregcount=0 --machine 32 --compile -arch sm_13 -g -Xcompiler “/EHsc /nologo /Od /Zi /MTd " -o “Win32/Debug/template.cu.obj” “C:\Okos branchoff - current2\ODISCuda\template.cu”” exited with code 2. C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 4.1.targets

There is a good CUDA Median Filter function freely available in ArrayFire. Enjoy!

Thank you, I’ll download and have a look

Unfortunately ArrayFire didn’t have what I needed.

I still need to find a way to do recursions in Visual Studios.

Am I suppose to add “-arch=sm_20” under Configuration Properties -> CUDA C/C++ -> Command Line?

Maybe try non-recursive quicksort? (http://www.seeingwithc.org/topic2html.html)