1

As OpenCL-enabled software needs to be packaged with source code of OpenCL kernels, minification and obfuscation seems to be a standard requirement for OpenCL deployment, at least for commercial applications.

Which tools could be used for minification/obfuscation of OpenCL/WebCL code?

Update: my deployment target is WebCL, so I am mostly interested in minification, but obfuscation could provide similar result.

Marat Dukhan
  • 11,993
  • 4
  • 27
  • 41
  • 1
    Have you considered generating your kernels into SPIR? SPIR is a standard for non-source kernel representation https://www.khronos.org/spir. OpenCL platforms are now rolling out SPIR support http://streamcomputing.eu/blog/2013-12-27/opencl-spir-by-example/ – Ruyk Jun 08 '14 at 13:20
  • My target is WebCL, which is written against OpenCL 1.1 spec, thus no SPIR. – Marat Dukhan Jun 08 '14 at 23:04

1 Answers1

3

Pack kernel code inside C string or compile it & save to binary or SPIR (as Ruyk said). Even if binary is disassembled, complicated kernels are usually not that easy to understand. E. g. in game development, shaders are stored in source code.

Roman Arzumanyan
  • 1,784
  • 10
  • 10
  • My deployment target is WebCL, and my main concern is about sending redundant source bytes over network. So I mostly need OpenCL minifier, albeit an obfuscator could work as well. – Marat Dukhan Jun 08 '14 at 23:15