Cutensor: how to set the stride?

I want to create a non-packed tensor, i.e. the stride is larger than the minimum defined by extent. I can’t find any documentation how to do this. However, the documentation does state that it’s possible (towards the top of the user guide):
https://docs.nvidia.com/cuda/cutensor/user_guide.html
The examples that come with cutensor only have packed tensors.

basically, for non-packed you’d have to compute the strides manually and pass it where we currently pass NULL in the example for the tensor descriptors (e.g. https://gitlab-master.nvidia.com/cuda-hpc-libraries/cudalibrarysamples/-/blob/master/cutensor/contraction.cu#L194 ).

1 Like