cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

jackun
Adept I

OpenCL frontend appends gibberish to kernel source

Something weird happens to my source. Random strings like '(', 'PA(' or  'PAD(' get appended to intermediary kernel source. It worked in debug build and failed in release. But another app fails to compile opencl kernels in both. Looks like buffer overflow/memory leak

App's source is in repo (in part based on AMD's OpenEncode sample): jackun/openencodevfw · GitHub

Kernels' source: openencodevfw/OpenEncodeVFW/NV12_kernels.cl at master · jackun/openencodevfw · GitHub

0 Likes
2 Replies
himanshu_gautam
Grandmaster

I see you are using FindResourceExA to read the kernel files. Can you tell, why was that needed?

I had seen similar errors with normal file reading when the reading was not done properly using binary flag.

0 Likes

Adding as resource for convenience so i don't have to worry about current working directory etc. But debugger shows that strlen is the same as file size so it should be correctly reading it from resource. I thought it might be because character encoding, but compiler seems to "eat" it as is. I'll test some more with writing back to file etc.

But just adding comment ( // ) at the end as a workaround for now doesn't bother me. Just letting you guys know just in case.

0 Likes