Skip to main content

OpenACC Based GPU Parallelization of Plane Sweep Algorithm for Geometric Intersection

  • Conference paper
  • First Online:
Accelerator Programming Using Directives (WACCPD 2018)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 11381))

Included in the following conference series:


Line segment intersection is one of the elementary operations in computational geometry. Complex problems in Geographic Information Systems (GIS) like finding map overlays or spatial joins using polygonal data require solving segment intersections. Plane sweep paradigm is used for finding geometric intersection in an efficient manner. However, it is difficult to parallelize due to its in-order processing of spatial events. We present a new fine-grained parallel algorithm for geometric intersection and its CPU and GPU implementation using OpenMP and OpenACC. To the best of our knowledge, this is the first work demonstrating an effective parallelization of plane sweep on GPUs.

We chose compiler directive based approach for implementation because of its simplicity to parallelize sequential code. Using Nvidia Tesla P100 GPU, our implementation achieves around 40X speedup for line segment intersection problem on 40K and 80K data sets compared to sequential CGAL library.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions


  1. 1.

  2. 2.

  3. 3.


  1. Agarwal, D., Puri, S., He, X., Prasad, S.K.: A system for GIS polygonal overlay computation on linux cluster - an experience and performance report. In: 26th IEEE International Parallel and Distributed Processing Symposium Workshops & PhD Forum, IPDPS 2012, Shanghai, China, 21–25 May 2012, pp. 1433–1439 (2012).

  2. Aghajarian, D., Prasad, S.K.: A spatial join algorithm based on a non-uniform grid technique over GPGPU. In: Proceedings of the 25th ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems, p. 56. ACM (2017)

    Google Scholar 

  3. Atallah, M.J., Goodrich, M.T.: Efficient plane sweeping in parallel. In: Proceedings of the Second Annual Symposium on Computational Geometry, pp. 216–225. ACM (1986)

    Google Scholar 

  4. Audet, S., Albertsson, C., Murase, M., Asahara, A.: Robust and efficient polygon overlay on parallel stream processors. In: Proceedings of the 21st ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems, pp. 304–313. ACM (2013)

    Google Scholar 

  5. Bentley, J.L., Ottmann, T.A.: Algorithms for reporting and counting geometric intersections. IEEE Trans. Comput. 9, 643–647 (1979)

    Article  Google Scholar 

  6. Franklin, W.R., Narayanaswami, C., Kankanhalli, M., Sun, D., Zhou, M.C., Wu, P.Y.: Uniform grids: a technique for intersection detection on serial and parallel machines. In: Proceedings of Auto Carto, vol. 9, pp. 100–109. Citeseer (1989)

    Google Scholar 

  7. Goodrich, M.T.: Intersecting line segments in parallel with an output-sensitive number of processors. SIAM J. Comput. 20(4), 737–755 (1991)

    Article  MathSciNet  Google Scholar 

  8. Goodrich, M.T., Ghouse, M.R., Bright, J.: Sweep methods for parallel computational geometry. Algorithmica 15(2), 126–153 (1996)

    Article  MathSciNet  Google Scholar 

  9. Khlopotine, A.B., Jandhyala, V., Kirkpatrick, D.: A variant of parallel plane sweep algorithm for multicore systems. IEEE Trans. Comput.-Aided Des. Integr. Circ. Syst. 32(6), 966–970 (2013)

    Article  Google Scholar 

  10. McKenney, M., Frye, R., Dellamano, M., Anderson, K., Harris, J.: Multi-core parallelism for plane sweep algorithms as a foundation for GIS operations. GeoInformatica 21(1), 151–174 (2017)

    Article  Google Scholar 

  11. McKenney, M., De Luna, G., Hill, S., Lowell, L.: Geospatial overlay computation on the GPU. In: Proceedings of the 19th ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems, pp. 473–476. ACM (2011)

    Google Scholar 

  12. McKenney, M., McGuire, T.: A parallel plane sweep algorithm for multi-core systems. In: Proceedings of the 17th ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems, pp. 392–395. ACM (2009)

    Google Scholar 

  13. OSM: OpenStreet Map Data (2017).

  14. Prasad, S., et al.: Parallel processing over spatial-temporal datasets from geo, bio, climate and social science communities: a research roadmap. In: 6th IEEE International Congress on Big Data, Hawaii (2017)

    Google Scholar 

  15. Puri, S., Prasad, S.K.: A parallel algorithm for clipping polygons with improved bounds and a distributed overlay processing system using MPI. In: 2015 15th IEEE/ACM International Symposium on Cluster, Cloud and Grid Computing (CCGrid)(CCGRID), pp. 576–585, May 2015.

  16. Puri, S., Paudel, A., Prasad, S.K.: MPI-vector-IO: parallel I/O and partitioning for geospatial vector data. In: Proceedings of the 47th International Conference on Parallel Processing, ICPP 2018, pp. 13:1–13:11. ACM, New York (2018).

  17. Puri, S., Prasad, S.K.: Output-sensitive parallel algorithm for polygon clipping. In: 43rd International Conference on Parallel Processing, ICPP 2014, Minneapolis, MN, USA, 9–12 September 2014, pp. 241–250 (2014).

Download references


This work is partly supported by the National Science Foundation CRII Grant No. 1756000. We gratefully acknowledge the support of NVIDIA Corporation with the donation of the Titan X Pascal GPU used for this research. We also acknowledge XSEDE for providing access to NVidia Tesla P100 available in PSC Bridges cluster.

Author information

Authors and Affiliations


Corresponding author

Correspondence to Anmol Paudel .

Editor information

Editors and Affiliations

Appendix A Artifact Description Appendix

Appendix A Artifact Description Appendix

1.1 A.1 Description

Check-List (Artifact Meta Information)

  • Algorithm:

    All algorithms are mentioned and described in the paper itself and can be referred to in Algorithms 1 and 3.

  • Program:

    The Computational Geometry Algorithms Library (CGAL) and Geometry Engine Open Source (GEOS) were external libraries that were used.

  • Compilation:

    Compilations were done using the g++ compiler and pgc++ compilers.

    for OpenACC: pgc++ -acc -ta=tesla:cc60 -o prog prog.cpp

    for OpenMP: g++ -fopenmp -o prog prog.cpp

    for CGAL: g++ -lcgal -o prog prog.cpp

    for GEOS: g++ -lgeos -o prog prog.cpp

  • Hardware:

    Description of the machines used to run code can be found in Sect. 5.1 for further information.

  • Publicly available:

    CGAL, GEOS, OpenMP, OpenACC, gcc and pgcc are all publicly available.

How Software Can Be Obtained (if Available). All of the software and code we used to build up our experiments were freely and publicly available. However, our code implementation can be found in the website:

Hardware Dependencies. To be able to get the most out of OpenMP, a multicore CPU would be needed. And to be able to run OpenACC kernels a GPU would be needed.

Software Dependencies. CGAL, GEOS, OpenMP and OpenACC libraries must be installed. Compilers like gcc and pgcc are also needed.

Datasets. Real world spatial data were used and datasets containing random lines were generated. Please refer to Sect. 5.1 for more information. Generated datasets are also posted in the website:, however they can be generated on your own.

1.2 A.2 Installation

  1. 1.

    Configure the multicore CPUs and GPU to run on your system

  2. 2.

    Install the necessary libraries

  3. 3.

    Download or generate the necessary datasets

  4. 4.

    Download the code

  5. 5.

    Check that the datasets are in the proper directory pointed by the code, if not then fix it

  6. 6.

    Compile the code

  7. 7.

    Execute the compiled executable

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Paudel, A., Puri, S. (2019). OpenACC Based GPU Parallelization of Plane Sweep Algorithm for Geometric Intersection. In: Chandrasekaran, S., Juckeland, G., Wienke, S. (eds) Accelerator Programming Using Directives. WACCPD 2018. Lecture Notes in Computer Science(), vol 11381. Springer, Cham.

Download citation

  • DOI:

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-12273-7

  • Online ISBN: 978-3-030-12274-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics