Skip to content

Pre compilation vs run time compilation in OpenCL

tingxingdong edited this page Jun 22, 2016 · 1 revision

# Pre-compile (or called offline compile):

Compile/build OpenCL kernels to binary file, save to the disk, and load them during run time (or called execution time)

  • Drawback: Assume users know their device before hand. Built code are device-specific. like, the code compiled for Hawaii may (I only say may) not run on Fiji, vice verse.
  • Advantage: no overhead of loading kernels

No-precompile = online compile = run time compile.

Build in the run time

  • Advantage: not device dependent. Query device first and then build upon it.
  • Drawback: There is latency of loading. Yet, the kernel is usually cached. So the latency of subsequent calling is minimized.