toaarnio / llvm-ir-memprotect

LLVM IR instrumentation for protection against out-of-bounds memory accesses
Mozilla Public License 2.0
9 stars 2 forks source link

printf() should not be used in test kernels #22

Open toaarnio opened 11 years ago

toaarnio commented 11 years ago

printf() is not a built-in function in OpenCL C, so it shouldn't be used in kernel code without enabling the appropriate extension:

pragma OPENCL EXTENSION cl_khr_printf : enable

Furthermore, if we're expecting the validator to reject a kernel, we need to be sure that it's getting rejected for the right reasons, not just because it happens to contain a printf().

elhigu commented 11 years ago

Checking all other validations of webcl should probably be done in higher level when doing syntax checking or in separate validation pass and this pass would be dedicated to just memory protection part.

However printf validations should be possible to be removed by changing kernel runner to have an extra argument to choose if any of the kernel arguments should be printed out after execution.