Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
Signed-off-by: Haoyang Li <[email protected]>
  • Loading branch information
thirtiseven committed Dec 7, 2023
1 parent 944863b commit 97e64af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/main/cpp/src/cast_float_to_string.cu
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ struct float_to_string_fn {
cudf::size_type* d_offsets;
char* d_chars;

__device__ cudf::size_type compute_output_size(FloatType value) const
__device__ cudf::size_type compute_output_size(cudf::size_type idx) const
{
auto const value = d_floats.element<FloatType>(idx);
bool constexpr is_float = std::is_same_v<FloatType, float>;
return static_cast<cudf::size_type>(
ftos_converter::compute_ftos_size(static_cast<double>(value), is_float));
Expand All @@ -61,7 +62,7 @@ struct float_to_string_fn {
if (d_chars != nullptr) {
float_to_string(idx);
} else {
d_offsets[idx] = compute_output_size(d_floats.element<FloatType>(idx));
d_offsets[idx] = compute_output_size(idx);
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/main/cpp/tests/cast_float_to_string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "cast_string.hpp"
#include <cast_string.hpp>

#include <cudf_test/base_fixture.hpp>
#include <cudf_test/column_wrapper.hpp>
Expand Down

0 comments on commit 97e64af

Please sign in to comment.