由衷地感谢滕老师的指导与帮助。
This is a project for learning parallel programming, which realizes pixelation of .wkt
data on CPU and GPU platform.
- On the CPU platform, this project realizes the parallel programming of
pThread
andOpenMP
. - On the CPU platform,this project realizes the parallel programming of
CUDA
.
$ git clone --recursive https://github.com/KMushaL/ParallelPixelization.git
Configure Options
- USE_OPENMP
- This option is enabled by default. It enables
OpenMP
instead ofpThread
.
- This option is enabled by default. It enables
- USE_CUDA
- This option is enabled by default. If enables
CUDA
and to further generate the corresponding executable file.
- This option is enabled by default. If enables
Then run the follow shell to complete build.
$ cmake -S . -B [-D <option>=<value>]
$ cd build
$ make
There are some params can be passed when run the executable file.
CPU
Params
-
in
- Specify the path to the
.wkt
file, If no value is passed, thebigpolygon.wkt
file in theres
directory will be used. - e.g.
--in ${path to your file}
- Specify the path to the
-
ps
- A
double
value specifying the pixel size, the default value is 10. - e.g.
--ps 1
- A
-
th
- An
integer
value specifying the number of threads to run, the default value is 16. - e.g.
--th 8
- An
Then run the follow shell.
$ ./CPU_PIXEL.out [--<param> <value>]
GPU
Params
-
in
- Specify the path to the
.wkt
file, If no value is passed, thebigpolygon.wkt
file in theres
directory will be used. - e.g.
--in ${path to your file}
- Specify the path to the
-
ps
- A
double
value specifying the pixel size, the default value is 1. - e.g.
--ps 1
- A
Then run the follow shell.
$ ./GPU_PIXEL.out [--<param> <value>]
There are some test results on my laptop, the configuration is as follows:
CPU: Intel 11th Gen Core i7-11800H
GPU: Nvidia Geforce RTX 3060(Laptop)
- pThread vs OpenMP (pixel_size=1)
-
OpenMP vs CUDA (pixel_size=0.05)
OpenMP(16 threads): 17715.5s
CUDA: 19.9403s