Skip to content

Commit 66dfd43

Browse files
Fixes to CCCL.C
1 parent 9c23258 commit 66dfd43

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

c/parallel/src/radix_sort.cu

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,9 @@ CUresult cccl_device_radix_sort_build_ex(
204204
const char* name = "test";
205205

206206
const auto key_cpp = cccl_type_enum_to_name(input_keys_it.value_type.type);
207-
const auto value_cpp =
208-
input_values_it.type == cccl_iterator_kind_t::CCCL_POINTER && input_values_it.state == nullptr
209-
? "cub::NullType"
210-
: cccl_type_enum_to_name(input_values_it.value_type.type);
207+
const auto keys_only =
208+
input_values_it.type == cccl_iterator_kind_t::CCCL_POINTER && input_values_it.state == nullptr;
209+
const auto value_cpp = keys_only ? "cub::NullType" : cccl_type_enum_to_name(input_values_it.value_type.type);
211210
const std::string op_src =
212211
(decomposer.name == nullptr || (decomposer.name != nullptr && decomposer.name[0] == '\0'))
213212
? "using op_wrapper = cub::detail::identity_decomposer_t;"
@@ -224,15 +223,16 @@ CUresult cccl_device_radix_sort_build_ex(
224223
case CCCL_FLOAT32:
225224
return cub::detail::type_t::float32;
226225
case CCCL_FLOAT64:
227-
return cub::detail::type_t::float32;
226+
return cub::detail::type_t::float64;
228227
default:
229228
return cub::detail::type_t::other;
230229
}
231230
}();
232231

233232
const auto cub_arch_policies = cub::detail::radix_sort::arch_policies{
234233
static_cast<int>(input_keys_it.value_type.size),
235-
static_cast<int>(input_values_it.value_type.size),
234+
// FIXME(bgruber): input_values_it.value_type.size is 4 when it represents cub::NullType, which is very odd
235+
keys_only ? 0 : static_cast<int>(input_values_it.value_type.size),
236236
int{sizeof(OffsetT)},
237237
key_type};
238238

0 commit comments

Comments
 (0)