Skip to main content

Abstract

Recently, C-based OpenCL design environment is proposed to design FPGA (field programmable gate array) accelerators. Although many c-programs can be executed on FPGAs, the best c-code for a CPU may not be the most appropriate one for an FPGA. Users must have some knowledge about computer architecture in order to write a good OpenCL code. In addition, OpenCL-based design process requires several hours of compilation time, because re-writing and compiling many different OpenCL codes may require a very large design time. To solve this problem, we propose an automatic optimization method. We accurately predict the kernel performance using the log files generated at the initial stage of the compilation. Then we find the optimized FPGA architecture by searching all possible design parameters. We implement the proposed method to find the optimized architecture for stencil computation. According to the results, the design time has been reduced to 6–11% of the conventional approach.

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

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 109.99
Price excludes VAT (USA)
  • Durable hardcover 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

Similar content being viewed by others

References

  1. Czajkowski, T.S., Neto, D., Kinsner, M., Aydonat, U., Wong, J., Denisenko, D., Yiannacouras, P., Freeman, J., Singh, D.P., Brown, S.D.: OpenCL for FPGAs: Prototyping a Compiler, International Conference on Engineering of Reconfigurable Systems and Algorithms (ERSA), pp. 3–12 (2012)

    Google Scholar 

  2. Dohi, K., Okina, K., Soejima, R., Shibata, Y., Oguri, K.: Performance modeling of stencil computing on a stream-based FPGA accelerator for efficient design space exploration. IEICE Trans. Inf. Syst. E98-D(2), 298–308 (2015)

    Google Scholar 

  3. Khronos Group: The open standard for parallel programming of heterogeneous systems. https://www.khronos.org/opencl/

  4. Intel: SDK for OpenCL. https://www.altera.com/products/design-software/embedded-software-developers/opencl/overview.html

  5. Jia, Q., Zhou, H.: Tuning stencil codes in OpenCL for FPGAs. In: IEEE 34th International Conference on Computer Design (ICCD), pp. 249–256 (2016)

    Google Scholar 

  6. Krommydas, K., Sasanka, R., Feng, W.: GLAF: a visual programming and auto-tuning framework for parallel computing. In: IEEE 44th International Conference on Parallel Processing (ICPP), pp. 859–868 (2015)

    Google Scholar 

  7. Krommydas, K., Sasanka, R., Feng, W.: Bridging the FPGA programmability-portability Gap via automatic OpenCL code generation and tuning. In: IEEE 27th International Conference on Application-Specific Systems, Architectures and Processors (ASAP), pp. 213–218 (2016)

    Google Scholar 

  8. Karniadakis, G., Sherwin, S.: Spectral/hp Element Methods for Computational Fluid Dynamics. Oxford University Press (2013)

    Google Scholar 

  9. Roth, G., Mellor-Crummey, J., Kennedy, K., Brickner, R.G.: Compiling stencils in high performance fortran. In: Proceedings of the 1997 ACM/IEEE Conference on Supercomputing, pp. 1–20 (1997)

    Google Scholar 

  10. Sano, K., Hatsuda, Y., Yamamoto, S.: Multi-FPGA accelerator for scalable stencil computation with constant memory bandwidth. IEEE Trans. Parallel Distrib. Syst. 25(3), 695–705 (2014)

    Article  Google Scholar 

  11. Waidyasooriya, H.M., Hariyama, M.: Hardware-Acceleration of short-read alignment based on the burrows-wheeler transform. IEEE Trans. Parallel Distrib. Syst. 27(5), 1358–1372 (2016)

    Article  Google Scholar 

  12. Waidyasooriya, H.M., Takei, Y., Tatsumi, S., Hariyama, M.: OpenCL-Based FPGA-Platform for stencil computation and its optimization methodology. IEEE Trans. Parallel Distrib. Syst. 28(5), 1390–1402 (2017)

    Article  Google Scholar 

  13. Yee, K.S.: Numerical solution of initial boundary value problems involving Maxwells equations in isotropic media. IEEE Trans. Antennas Propag. 14(3), 302–307 (1966)

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding authors

Correspondence to Hasitha Muthumala Waidyasooriya or Masanori Hariyama .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer International Publishing AG

About this chapter

Cite this chapter

Endo, T., Waidyasooriya, H.M., Hariyama, M. (2018). Automatic Optimization of OpenCL-Based Stencil Codes for FPGAs. In: Lee, R. (eds) Software Engineering, Artificial Intelligence, Networking and Parallel/Distributed Computing. SNPD 2017. Studies in Computational Intelligence, vol 721. Springer, Cham. https://doi.org/10.1007/978-3-319-62048-0_6

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-62048-0_6

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-62047-3

  • Online ISBN: 978-3-319-62048-0

  • eBook Packages: EngineeringEngineering (R0)

Publish with us

Policies and ethics