[SOLVED] How to hide/move CUDAFYSOURCETEMP.cu and CUDAFYSOURCETEMP.ptx?

Nov 23, 2012 at 10:11 AM
Edited Nov 23, 2012 at 10:48 AM

Hi,

I've got a problem. I don't want the other people see my source code in this files (see the subject). how can I hide them?

Thank you!

Nov 24, 2012 at 10:39 PM
Edited Nov 24, 2012 at 10:41 PM

Quick and drty way is to delete them when the kernel finishes. I don't know off-hand if there is a way to save them in memory instead of on disk, but yo could checkthat out.

However, it is unlikely that you are inventing something patentable, or worthy of trade secret, in the kernel that cannot be readily re-engineered by dozens, if not hundreds or thousands, of people. Is this really where you wish to expend your precious time?

Remember also, C# produces MSIL output, not binary, and there are many fine decompilers available. In fact, CUDAfy works by employing one of those decompilers to produce the .CU file that you are so keen to protect!!!

Nov 25, 2012 at 8:14 PM
Edited Nov 25, 2012 at 8:15 PM

Those files aren't meant to be shipped with your product, nor are they supposed to be generated on a end-user's pc. What should be shipped is the cudafy module. Check the CUDAfy's manual page 25 (IMPROVING PERFORMANCE BY CACHING CUDAFY MODULES). That's the file you should be shipping out. And you may encrypt it any way you like and store it wherever you want, since it's possible to deserialize it from a Stream.

All that's very well and good, but what the previous poster wrote is also true: if anyone wishes to see your source code and has the technical know-how (which needn't be very stratospheric), they will. Of course, you can certainly try to make life harder for them, if you can afford the time.

cheers

Dec 1, 2012 at 7:09 AM
Edited Dec 1, 2012 at 7:10 AM

Thank you. I will try!

Dec 1, 2012 at 7:10 AM
Edited Dec 1, 2012 at 7:10 AM
pedritolo1 wrote:

Those files aren't meant to be shipped with your product, nor are they supposed to be generated on a end-user's pc. What should be shipped is the cudafy module. Check the CUDAfy's manual page 25 (IMPROVING PERFORMANCE BY CACHING CUDAFY MODULES). That's the file you should be shipping out. And you may encrypt it any way you like and store it wherever you want, since it's possible to deserialize it from a Stream.

All that's very well and good, but what the previous poster wrote is also true: if anyone wishes to see your source code and has the technical know-how (which needn't be very stratospheric), they will. Of course, you can certainly try to make life harder for them, if you can afford the time.

cheers

But could you send to me a code-sample how can I do it?

Dec 2, 2012 at 12:59 AM
Edited Dec 2, 2012 at 1:01 AM

Ok, let's see. Simple version:

1 - Before you generate your deployment package, write code like this in order to generate the file containing the cudafy module:

CudafyModule km = CudafyTranslator.Cudafy(...);
km.Serialize(moduleFilenameHere);



This will save the module in the file "moduleFilenameHere". This is the file you'll be distributing.

2 - Now, change your code to this:

//CudafyModule km = CudafyTranslator.Cudafy(...);
//km.Serialize(moduleFilenameHere);
CudafyModule km = CudafyModule.Deserialize(moduleFilenameHere);

where "moduleFilenameHere" will be the path on the final client's machine where the module was installed.

3 - If later you need to modify your [Cudafy] kernels, you'll have to repeat steps 1 and 2.

good luck