Skip to content

Conversation

@JYMiracle305
Copy link
Contributor

@JYMiracle305 JYMiracle305 commented Jan 29, 2026

为不同版本的 NVIDIA CUB 库提供统一的归约操作符(Sum/Max/Min等)类型别名,在 CUB 2.8.0 及以上版本使用 cuda::std 中的函数对象,旧版本则回退到传统的 cub:: 操作符,以屏蔽版本差异实现向后兼容。

@JYMiracle305 JYMiracle305 requested review from Chamberlain0w0, chen2021673 and kilinchange and removed request for kilinchange January 29, 2026 01:57
thread_max = fmaxf(thread_max, common::cuda::Cast<float>(input_ptr[base + i]));
}
const float block_max = cub::BlockReduce<float, BLOCK_SIZE>(shared.reduce).Reduce(thread_max, ::cuda::maximum<>());
const float block_max = cub::BlockReduce<float, BLOCK_SIZE>(shared.reduce).Reduce(thread_max, CubSumOp());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里为什么是 CubSumOp 不是 CubMaxOp 啊

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里替换的时候替换错了,我改一下

Copy link
Contributor

@chen2021673 chen2021673 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants