namhyung/uftrace

demangling failure with __device_stub_ prefix

honggyukim opened this issue · 5 comments

There are some symbols begin with __device_stub_, but it makes our demangler fails demangling the symbol as follows.

$ ./misc/demangler __device_stub__Z13mul_mat_vec_qIL9ggml_type13ELi2EEvPKvS2_Pfiiii
__device_stub__Z13mul_mat_vec_qIL9ggml_type13ELi2EEvPKvS2_Pfiiii

If the __device_stub_ prefix is removed, then it can be demangled as follows.

$ ./misc/demangler _Z13mul_mat_vec_qIL9ggml_type13ELi2EEvPKvS2_Pfiiii
mul_mat_vec_q

So I would like to see treat the special prefix __device_stub_ and parse the rest of symbols. The final demangled output can be shown as follows.

$ ./misc/demangler __device_stub__Z13mul_mat_vec_qIL9ggml_type13ELi2EEvPKvS2_Pfiiii
__device_stub_mul_mat_vec_q

The same problem is shown in c++filt tool as well.

$ c++filt __device_stub__Z13mul_mat_vec_qIL9ggml_type13ELi2EEvPKvS2_Pfiiii
__device_stub__Z13mul_mat_vec_qIL9ggml_type13ELi2EEvPKvS2_Pfiiii

If the __device_stub_ prefix is removed, then it can be demangled as follows.

$ c++filt _Z13mul_mat_vec_qIL9ggml_type13ELi2EEvPKvS2_Pfiiii
void mul_mat_vec_q<(ggml_type)13, 2>(void const*, void const*, float*, int, int, int, int)

Hmm.. do you know when it adds the __device_stub_ prefix?

It's added by nvcc cuda compiler.

Ok, thanks. Do you know what else prefix it can add also? Preferably any documentation for that.

Anyway I think we can skip the prefix like we do with _GLOBAL__sub_I_.

Sure, I will try to list up for cuda compiler later.