cudnnBackendGetAttribute elementCount confusion

Hello! I’m fairly confused about the use of the elementCount parameter in the cudnnBackendGetAttribute function. Intuitively, I’d assume it’s used purely as a return value to store the total number of attributes for the descriptor. However, in the cudnn documentation it is marked as an input.

Is this just a typo in the docs, or can this value also be used as an input?

1 Like

Hi @brian223 ,
Have reported this to team, and waiting to hear from them.
Will confirm on teh same.

Thanks

Further to the above, I found a case where the elementCount is different depending on whether you set the requestedElementCount to zero or to another value. This feels like a bug.

i64 num_results = 0;
cudnnBackendGetAttribute(query, CUDNN_ATTR_ENGINEHEUR_RESULTS,
    CUDNN_TYPE_BACKEND_DESCRIPTOR, 0, &num_results, 0);

//...  initialize an array of results, called `query results`

i64 real_num_results = 0;
cudnnBackendGetAttribute(query, CUDNN_ATTR_ENGINEHEUR_RESULTS,
    CUDNN_TYPE_BACKEND_DESCRIPTOR, num_results, &real_num_results, query_results);

for a simple graph consisting of a single float32 matmul, this gives me 9 for num_results, but 3 for real_num_results.