Closed Tobiaswei closed 4 years ago
We didn't write any output funtions, please paste your code here. As a recommand, please see pba-plus-2D/main.cpp line 145-148
.
So does the outputVoronoi
array corresponding to "Output: 2D texture. Each pixel is represented as two "short" integer " refering to its nearest site. I assumed the outputVoronoi
should contain the nearest point coordinates respect to the random generate 2D texture.
Thanks for your reply!
Yes... outputVoronoi
stores the coordinate of the nearest point generated in generateRandomPoints()
for each pixel.
So do u have any problems now?
outputVoronoi
seems to be all zero. And it seems not jump into the kernel function since I cannot printout from any kernel function. Do you have any ideas whats wrong with it ?
I compile it with nvcc pba/pba2DHost.cu main.cpp -o dt.o
I can get the correct answer with nvcc main.cpp pba/pba2DHost.cu -o dt
.
It sounds wired... here are the parameters I used int fboSize = 30; int nVertices = 50;
output result.txt.txt
Do you have any suggestions?
fboSize = 30
is too small for PBA+, the texture size should be multiple of 64. You can see main.cpp line 53-55
for more details.
If u want to construct DT for a small texture, you can simply put it into a larger square with a size of multiple of 64. This is for a better performance of CUDA.
Yes, I reset the fboSize = 2048 nVertices = 100
and it works correctly, giving the error 0. However, when I reset the fboSize = 1024 nVertices = 100
it gives a really large error value 1043722
Is there anything I have to change?
I guess you didn't set the parameters phase1Band, phase2Band, phase3Band
correctly.
You can see main.cpp line 53-55
for the constraints of the parameters. Or you can take the suggested parameters on our website (Table 2. Appropriate parameters of PBA+ on different GPUs).
Thanks! Really appreciate!
As title, I just copy the code and run it.