对于PTX文件中的某些损坏的名称,c ++ filt不够积极 [英] c++filt not aggressive enough for some of the mangled names in PTX files

查看:331
本文介绍了对于PTX文件中的某些损坏的名称,c ++ filt不够积极的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过c ++ filt过滤已编译的PTX,但是它只会使某些名称/标签不符合要求,并保留某些原样.例如,这:

I'm filtering my compiled PTX through c++filt, but it only demangles some of the names/labels and leaves some as-is. For example, this:

func  (.param .b32 func_retval0) _ZN41_INTERNAL_19_gather_bits_cpp1_ii_56538e7c6__shflEiii(
        .param .b32 _ZN41_INTERNAL_19_gather_bits_cpp1_ii_56538e7c6__shflEiii_param_0,
        .param .b32 _ZN41_INTERNAL_19_gather_bits_cpp1_ii_56538e7c6__shflEiii_param_1,
        .param .b32 _ZN41_INTERNAL_19_gather_bits_cpp1_ii_56538e7c6__shflEiii_param_2
)

按如下所示进行了散乱处理:

is demangled as this:

.func  (.param .b32 func_retval0) _INTERNAL_19_gather_bits_cpp1_ii_56538e7c::__shfl(int, int, int)(
        .param .b32 _ZN41_INTERNAL_19_gather_bits_cpp1_ii_56538e7c6__shflEiii_param_0,
        .param .b32 _ZN41_INTERNAL_19_gather_bits_cpp1_ii_56538e7c6__shflEiii_param_1,
        .param .b32 _ZN41_INTERNAL_19_gather_bits_cpp1_ii_56538e7c6__shflEiii_param_2
)

而不是至少这个:

.func  (.param .b32 func_retval0) _INTERNAL_19_gather_bits_cpp1_ii_56538e7c::__shfl(int, int, int)(
        .param .b32 _ZN41_INTERNAL_19_gather_bits_cpp1_ii_56538e7c::__shfl(int, int, int)_param_0,
        .param .b32 _ZN41_INTERNAL_19_gather_bits_cpp1_ii_56538e7c::__shfl(int, int, int)_param_1,
        .param .b32 _ZN41_INTERNAL_19_gather_bits_cpp1_ii_56538e7c::__shfl(int, int, int)_param_2
)

我意识到c ++ filt没有对CUDA PTX的明确支持;但请注意,在示例中,未取消组合的名称与已取消组合的名称的区别仅在于添加了_param_0_param_1等后缀(还有一些问题,即应如何取消对这些名称的前缀进行重新组合的问题,但让我们忘了这一点)

I realize c++filt does not have explicit support for CUDA PTX; but note that the undemangled names differ from the demangled ones in the example merely by an addition _param_0, _param_1 etc. suffix (there's also the question of how the prefix of those names should be demangled, but let's forget about that).

  • 是否可以强制c ++ filt应用于参数名称/标签?而且更普遍的是,对于PTX文件中所有变形的C ++名称?
  • 除了已经拥有的格式"([-s|--format {none,auto,gnu,lucid,arm,hp,edg,gnu-v3,java,gnat,dlang}])以外,是否有可能/容易地通过增强CUDA的格式"来增强c ++ filt?
  • 如果在这种情况下不能使用c ++ filt或将其改编为适合使用,那么我应该如何进行拆包?
  • Is there something I can do force c++filt to also apply to the parameter names/labels as well? And more generally, to all of the mangled C++ names in the PTX file?
  • Is it possible/easy to augment c++filt with awareness of the the CUDA "format", in additional to the "formats" it has already ([-s|--format {none,auto,gnu,lucid,arm,hp,edg,gnu-v3,java,gnat,dlang}])?
  • If c++filt can't be used or adapted for use in this case, how should I go about doing the demangling?

推荐答案

设备功能的C ++实现遵循Itanium C ++ ABI.

The C++ implementation for device functions follows the Itanium C++ ABI.

c++filt实现了Itanium C ++ ABI符号的分解,因此,它可以从PTX源或ELF对象中分解内核名称和设备功能名称.

c++filt implements demangling of Itanium C++ ABI symbols, therefore, it can demangle kernel names and device function names from PTX source or ELF objects.

但是,您发布的其他符号是CUDA ABI符号. c++filt不支持这些,因为它不支持CUDA ABI.它们看起来是否相似无关紧要.如果您确实需要此功能,请向NVIDIA请愿,就像在ELF实用程序和其他内部组件上所做的那样,向工具链中添加CUDA ABI符号的解包器.

However, the other symbols you have posted are CUDA ABI symbols. c++filt doesn't support those because it doesn't support the CUDA ABI. Whether they might look similar or not is irrelevant. If you really need this, then petition NVIDIA to add a demangler for CUDA ABI symbols to the toolchain, as they have done with ELF utilities and other internals.

这篇关于对于PTX文件中的某些损坏的名称,c ++ filt不够积极的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆