Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Account for additional local memory requirements in Global dispatch #127

Merged
merged 9 commits into from
Jan 5, 2024
22 changes: 11 additions & 11 deletions src/portfft/descriptor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,19 +385,19 @@ class committed_descriptor {
IdxGlobal factor_wi = factor_size / factor_sg;
if (detail::can_cast_safely<IdxGlobal, Idx>(factor_sg) && detail::can_cast_safely<IdxGlobal, Idx>(factor_wi)) {
if (batch_interleaved_layout) {
// (local_memory_for_input + local_mem_for_store_modifier + local_mem_for_twiddles) < local_mem
return (sizeof(Scalar) *
(num_scalars_in_local_mem<detail::layout::BATCH_INTERLEAVED>(
detail::level::SUBGROUP, static_cast<std::size_t>(factor_size), SubgroupSize,
{static_cast<Idx>(factor_sg), static_cast<Idx>(factor_wi)}, temp_num_sgs_in_wg) +
static_cast<std::size_t>(factor_size) * LocalRange + 2 * static_cast<std::size_t>(factor_size))) <
return (2 *
num_scalars_in_local_mem<detail::layout::BATCH_INTERLEAVED>(
detail::level::SUBGROUP, static_cast<std::size_t>(factor_size), SubgroupSize,
{static_cast<Idx>(factor_sg), static_cast<Idx>(factor_wi)}, temp_num_sgs_in_wg) *
sizeof(Scalar) +
2 * static_cast<std::size_t>(factor_size) * sizeof(Scalar)) <
static_cast<std::size_t>(local_memory_size);
}
return (sizeof(Scalar) *
(num_scalars_in_local_mem<detail::layout::PACKED>(
detail::level::SUBGROUP, static_cast<std::size_t>(factor_size), SubgroupSize,
{static_cast<Idx>(factor_sg), static_cast<Idx>(factor_wi)}, temp_num_sgs_in_wg) +
static_cast<std::size_t>(factor_size) * LocalRange + 2 * static_cast<std::size_t>(factor_size))) <
return (num_scalars_in_local_mem<detail::layout::PACKED>(
detail::level::SUBGROUP, static_cast<std::size_t>(factor_size), SubgroupSize,
{static_cast<Idx>(factor_sg), static_cast<Idx>(factor_wi)}, temp_num_sgs_in_wg) *
sizeof(Scalar) +
2 * static_cast<std::size_t>(factor_size) * sizeof(Scalar)) <
hjabird marked this conversation as resolved.
Show resolved Hide resolved
static_cast<std::size_t>(local_memory_size);
}
return false;
Expand Down