escape sequences in string literals passed to extern functions break CUDA code generation
michael-kenzel opened this issue · 2 comments
michael-kenzel commented
example: we add
extern "device" {
fn "printf" cuda_device_print_i32(&[u8], i32) -> i32;
}
and call
cuda_device_print_i32("blub %d\n", 42);
the generated CUDA C++ code will end up looking like
printf_99098 = printf("blub %d
", 42);
resulting in compilation failure.
The problem would seem to be that CUDA C++ code generation does not escape string contents before outputting string literals. "pre-escaping" the string in the original impala source code would seem to be a temporary workaround:
cuda_device_print_i32("blub %d\\n", 42);
leissa commented
@richardmembarth can you have a look at this?
richardmembarth commented
Fixed in AnyDSL/thorin@d93d0def