meta_group_size
产 品 支 持 情 况
- Ascend 950PR/Ascend 950DT:支 持
- Atlas A3 训 练 系 列 产 品/Atlas A3 推 理 系 列 产 品:不 支 持
- Atlas A2 训 练 系 列 产 品/Atlas A2 推 理 系 列 产 品:不 支 持
- Atlas 200I/500 A2 推 理 产 品:不 支 持
- Atlas 推 理 系 列 产 品AI Core:不 支 持
- Atlas 推 理 系 列 产 品Vector Core:不 支 持
- Atlas 训 练 系 列 产 品:不 支 持
功 能 说 明
获 取 当 前 线 程 所 在 的 协 作 组 其 直 接 父 组 被 划 分 时 创 建 的 子 组 的 数 量。
函 数 原 型
C++
unsigned long long meta_group_size() const
参 数 说 明
无
返 回 值 说 明
直 接 父 组 被 划 分 时 创 建 的 子 组 的 数 量。
约 束 说 明
无
调 用 示 例
每 个 线 程 块 中 有1024个 线 程,以4个 线 程 为 一 小 组 划 分,总 共 可 划 分 出256个 子 组。
SIMT编 程 场 景:
C++using namespace cooperative_groups; __global__ void simt_kernel(...) { ... thread_block block = this_thread_block(); auto tile4 = tiled_partition<4>(block); unsigned long long group_size = tile4.meta_group_size(); // 返 回256 ... }SIMD与SIMT混 合 编 程 场 景:
C++using namespace cooperative_groups; __simt_vf__ inline void simt_kernel(...) { ... thread_block block = this_thread_block(); auto tile4 = tiled_partition<4>(block); unsigned long long group_size = tile4.meta_group_size(); // 返 回256 ... }