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

Fix CPU-only build for new FIL #5559

Merged
merged 2 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 19 additions & 14 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -341,29 +341,34 @@ if(BUILD_CUML_CPP_LIBRARY)

# FIL components
if(all_algo OR fil_algo)
if(CUML_ENABLE_GPU)
target_sources(${CUML_CPP_TARGET}
PRIVATE
# Current FIL
src/fil/fil.cu
src/fil/infer.cu
src/fil/treelite_import.cu
# Experimental FIL
src/experimental/fil/infer0.cu
src/experimental/fil/infer1.cu
src/experimental/fil/infer2.cu
src/experimental/fil/infer3.cu
src/experimental/fil/infer4.cu
src/experimental/fil/infer5.cu
src/experimental/fil/infer6.cu
src/experimental/fil/infer7.cu)
endif()
target_sources(${CUML_CPP_TARGET}
PRIVATE
src/fil/fil.cu
src/fil/infer.cu
src/fil/treelite_import.cu)
target_sources(${CUML_CPP_TARGET}
PRIVATE
# Experimental FIL
src/experimental/fil/infer0.cpp
src/experimental/fil/infer0.cu
src/experimental/fil/infer1.cpp
src/experimental/fil/infer1.cu
src/experimental/fil/infer2.cpp
src/experimental/fil/infer2.cu
src/experimental/fil/infer3.cpp
src/experimental/fil/infer3.cu
src/experimental/fil/infer4.cpp
src/experimental/fil/infer4.cu
src/experimental/fil/infer5.cpp
src/experimental/fil/infer5.cu
src/experimental/fil/infer6.cpp
src/experimental/fil/infer6.cu
src/experimental/fil/infer7.cpp
src/experimental/fil/infer7.cu)
src/experimental/fil/infer7.cpp)
endif()

# todo: organize linear models better
Expand Down
2 changes: 2 additions & 0 deletions cpp/include/cuml/experimental/fil/decision_forest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ struct decision_forest {

/** The operation used for postprocessing all outputs for a single row */
auto row_postprocessing() const { return row_postproc_; }
// Setter for row_postprocessing
void set_row_postprocessing(row_op val) { row_postproc_ = val; }
/** The operation used for postprocessing each element of the output for a
* single row */
auto elem_postprocessing() const { return elem_postproc_; }
Expand Down
8 changes: 8 additions & 0 deletions cpp/include/cuml/experimental/fil/forest_model.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ struct forest_model {
decision_forest_);
}

/** Setter for row_postprocessing() */
void set_row_postprocessing(row_op val)
{
return std::visit(
[&val](auto&& concrete_forest) { concrete_forest.set_row_postprocessing(val); },
decision_forest_);
}

/** The operation used for postprocessing each element of the output for a
* single row */
auto elem_postprocessing()
Expand Down