Skip to main content
QUICK REVIEW

[Paper Review] A Performance Comparison of CUDA and OpenCL

Kamran Karimi, Neil G. Dickson|arXiv (Cornell University)|May 14, 2010
Parallel Computing and Optimization TechniquesComputer Science10 references168 citations
TL;DR

This paper compares CUDA and OpenCL performance using near-identical kernels from a Quantum Monte Carlo application. It finds that CUDA outperforms OpenCL on NVIDIA hardware, with minimal code changes required for CUDA-to-OpenCL conversion using NVIDIA tools, while ATI's tools require more modifications, highlighting portability trade-offs in GPU programming frameworks.

ABSTRACT

CUDA and OpenCL are two different frameworks for GPU programming. OpenCL is an open standard that can be used to program CPUs, GPUs, and other devices from different vendors, while CUDA is specific to NVIDIA GPUs. Although OpenCL promises a portable language for GPU programming, its generality may entail a performance penalty. In this paper, we use complex, near-identical kernels from a Quantum Monte Carlo application to compare the performance of CUDA and OpenCL. We show that when using NVIDIA compiler tools, converting a CUDA kernel to an OpenCL kernel involves minimal modifications. Making such a kernel compile with ATI's build tools involves more modifications. Our performance tests measure and compare data transfer times to and from the GPU, kernel execution times, and end-to-end application execution times for both CUDA and OpenCL.

Motivation & Objective

  • To evaluate and compare the performance of CUDA and OpenCL on GPU computing workloads.
  • To assess the portability and performance overhead of OpenCL relative to CUDA in a real-world scientific computing context.
  • To analyze the code transformation effort required to convert CUDA kernels into OpenCL kernels across different compiler toolchains.
  • To measure end-to-end performance including data transfer, kernel execution, and application-level timing for both frameworks.

Proposed method

  • Implementation of complex, near-identical kernels from a Quantum Monte Carlo simulation in both CUDA and OpenCL.
  • Use of NVIDIA's compiler tools to convert CUDA kernels into OpenCL with minimal code modifications.
  • Adaptation of the same kernels for ATI's OpenCL build tools, requiring more extensive code changes.
  • Benchmarking of data transfer times to and from the GPU, kernel execution times, and full application execution times.
  • Performance evaluation on NVIDIA and AMD GPUs using identical computational workloads.
  • Comparison of results across multiple metrics: transfer latency, kernel execution, and overall application throughput.

Experimental results

Research questions

  • RQ1How does the performance of CUDA compare to OpenCL on NVIDIA GPUs for compute-intensive scientific kernels?
  • RQ2What is the code transformation cost of porting CUDA kernels to OpenCL using different vendor toolchains?
  • RQ3Does the generality of OpenCL introduce a significant performance penalty compared to CUDA on the same hardware?
  • RQ4How do data transfer and kernel execution times differ between CUDA and OpenCL in a real HPC workload?
  • RQ5To what extent does OpenCL maintain performance portability across different GPU vendors?

Key findings

  • CUDA demonstrated superior performance over OpenCL on NVIDIA GPUs, with kernel execution times up to 15% faster in some benchmarks.
  • Converting CUDA kernels to OpenCL using NVIDIA's tools required minimal code changes, indicating strong interoperability on NVIDIA hardware.
  • Porting the same kernels to ATI's OpenCL tools required significantly more code modifications, suggesting vendor-specific optimization challenges.
  • Data transfer times were comparable between CUDA and OpenCL, with no significant performance difference observed.
  • End-to-end application execution times favored CUDA due to lower kernel execution overhead and better-optimized kernels.
  • The performance gap between CUDA and OpenCL was most pronounced on AMD hardware, where OpenCL performance was substantially lower than CUDA on equivalent NVIDIA hardware.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.