Results 1 to 3 of 3

Thread: How to protect/hide my OpenCL C code?

  1. #1
    Newbie
    Join Date
    Oct 2013
    Posts
    4

    How to protect/hide my OpenCL C code?

    Dear all,

    I want to protect/hide my code and avoid users can see my kernel program.

    I worry that if users implement their own OpenCL API/driver, and I use on-line compiler, my kernel code can not be hidden because they will access my code easily and directly...

    How can I protect my OpenCL C code?

    How to let people be disable to see my program?

    I think I may use off-line compiler, but is it really safe?

    Thank you very much.

  2. #2
    Senior Member
    Join Date
    Dec 2011
    Posts
    126
    Option 1: Obfuscate your source and continue to use clCreateProgramWithSource. Remove all comments and make variable and function names meaningless. This will still work on all platforms and devices.
    Option 2: Only ship binary and use clCreateProgramWithBinary. The downside is that you'll have to pre-compile your program for all supported platforms and devices ahead of time and if your user has an unsupported device, you won't run on their hardware.
    Option 3: Wait for OpenCL SPIR to be available everywhere. This is a portable intermediate representation that is lower-level than source but higher level than binary. It is not well supported yet, so not really an option yet.

  3. #3
    Newbie
    Join Date
    Oct 2013
    Posts
    4
    Thank you very much! I will try them

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •