NVIDIA / cutlass

CUDA Templates for Linear Algebra Subroutines
Other
4.83k stars 835 forks source link

[QST] How to print the shape of the tensor? #1429

Open ziyuhuang123 opened 3 months ago

ziyuhuang123 commented 3 months ago

What is your question? // Get the appropriate blocks for this thread block auto cta_coord = makecoord(blockIdx.x, blockIdx.y, ); // (m,n,k) Tensor gA = local_tile(mA, cta_tiler, cta_coord, Step<_1, X,_1>{}); // (BLK_M,BLK_K,k) Tensor gB = local_tile(mB, cta_tiler, cta_coord, Step< X,_1,_1>{}); // (BLK_N,BLK_K,k) Tensor gC = local_tile(mC, cta_tiler, cta_coord, Step<_1,_1, X>{}); // (BLK_M,BLK_N)

I am learning "https://github.com/NVIDIA/cutlass/blob/c4e3e122e266644c61b4af33d0cc09f4c391a64b/media/docs/cute/0x_gemm_tutorial.md" but I do not know how to print the shape of gA, I tried "printf("%d, %d, %d\n", size<0>(gA), size<1>(gA), size<2>(gA));", and I get "0, 512, 0", but I should get 128, 128, 8.... why? Thanks!

I tried "printf("%d\n", gA.size());" but I get "524288"!! why?

thakkarV commented 3 months ago

cute::print(gA)

mnicely commented 3 months ago

@ziyuhuang123 is your issue resolved?

github-actions[bot] commented 2 months ago

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.