MCPcopy Create free account
hub / github.com/KnowingNothing/MatmulTutorial / block_id_in_cluster

Function block_id_in_cluster

include/common.h:435–441  ·  view source on GitHub ↗

Returns the relative dim3 block rank local to the cluster.

Source from the content-addressed store, hash-verified

433
434// Returns the relative dim3 block rank local to the cluster.
435DEVICE dim3 block_id_in_cluster() {
436 uint32_t x, y, z;
437 asm volatile("mov.u32 %0, %cluster_ctaid.x;\n" : "=r"(x) :);
438 asm volatile("mov.u32 %0, %cluster_ctaid.y;\n" : "=r"(y) :);
439 asm volatile("mov.u32 %0, %cluster_ctaid.z;\n" : "=r"(z) :);
440 return {x, y, z};
441}
442
443// Returns the warp id in block
444DEVICE int warp_id_in_block() { return threadIdx.x / WARP_SIZE; }

Callers 2

PipelineTmaAsyncClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected