When comparing notes between cuda.core and cccl-rt @pciolkosz and I noticed one discrepancy. The public example code we have
|
# prepare launch config |
|
grid = 4 |
|
cluster = 2 |
|
block = 32 |
|
config = LaunchConfig(grid=grid, cluster=cluster, block=block) |
is meant to match the C++ counterpart
cudax::make_hierarchy(cudax::grid_dims(4), cudax::cluster_dims(2), cudax::block_dims(32));
However, it actually does not because cuda.core generates the following output today:
$ python thread_block_cluster.py
grid dim: (4, 1, 1)
cluster dim: (2, 1, 1)
block dim: (32, 1, 1)
done!
which is wrong. The reason is that we did not do a proper unit conversion internally. When .cluster is set, .grid = 4 should mean we have 4 clusters, not 4 blocks. The correct output should be
grid dim: (8, 1, 1)
cluster dim: (2, 1, 1)
block dim: (32, 1, 1)
When comparing notes between
cuda.coreandcccl-rt@pciolkosz and I noticed one discrepancy. The public example code we havecuda-python/cuda_core/examples/thread_block_cluster.py
Lines 67 to 71 in 127f798
is meant to match the C++ counterpart
However, it actually does not because
cuda.coregenerates the following output today:$ python thread_block_cluster.py grid dim: (4, 1, 1) cluster dim: (2, 1, 1) block dim: (32, 1, 1) done!which is wrong. The reason is that we did not do a proper unit conversion internally. When
.clusteris set,.grid = 4should mean we have 4 clusters, not 4 blocks. The correct output should be