Open
Description
This is a handy approach as suggested by @galv since the driver does not expose any queryable APIs for this purpose:
Hello pipul, there is not a direct API, but you can do this https://github.com/pytorch/pytorch/pull/137318/files#diff-d7302d133bb5e0890fc94de9aeea4d9d442555a3b40772c9db10edb5cf36a35cR424-R429
In other words:
for(size_t i = 0; cudaFuncGetParamInfo(func, i, ¶m_offset, ¶m_size) != CUDA_ERROR_INVALID_VALUE; i++) {} // i now contains the total number of arguments to your kernel.
I'm sure you can translate that to python.
Originally posted by @galv in #543 (reply in thread)