Conversation
add a FuncAttributes class to store all kernel attributes add an attributes property to the RawKernel class. This can be used to query the register and memory usage of the kernel.
460f503 to
79b9f95
Compare
|
Any feedback regarding this feature? I find it useful to be able to query the number of registers a |
kmaehashi
left a comment
There was a problem hiding this comment.
Thanks, I added some comments.
refactor attributes test as a separate test case memoize the kernel attributes.
|
Thanks @kmaehashi. I still need to remove |
build the dictionary within raw.pyx instead
|
Okay, this should now be ready for a new review. |
|
Please review #2120 prior to reviewing this PR again. That PR is an expansion of this one and adds support for setting attributes as well. I think most likely this PR can be closed in favor of that one. |
|
closed in favor of updated version in #2369 |
It is helpful to be able to query kernel attributes such as the number of registers that a
RawKernelis using. The implementation in this PR is based on wrappingcuFuncGetAttributesfrom the Driver API.I think a couple of these attiributes (
maxDynamicSharedSizeBytesandpreferredShmemCarveout) did not exist in CUDA 8.0. To deal with this, any attributes that return statusCUDA_ERROR_INVALID_VALUEget set to -1 to indicate they are unavailable.Note:
I initially tried using
cudaFuncGetAttributesfrom the Runtime API (which reads all of the attributes into a structure in one call). However, when I tried passing in the kernel function I always got:Perhaps this is because
extern "C"is used for theRawKernelsource, but I am not sure.