diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 0ad691fdbf..41013a4ed9 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -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 diff --git a/cpp/include/cuml/experimental/fil/decision_forest.hpp b/cpp/include/cuml/experimental/fil/decision_forest.hpp index c0e7433453..06738df043 100644 --- a/cpp/include/cuml/experimental/fil/decision_forest.hpp +++ b/cpp/include/cuml/experimental/fil/decision_forest.hpp @@ -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_; } diff --git a/cpp/include/cuml/experimental/fil/forest_model.hpp b/cpp/include/cuml/experimental/fil/forest_model.hpp index 93cc9c48fd..60cd031d37 100644 --- a/cpp/include/cuml/experimental/fil/forest_model.hpp +++ b/cpp/include/cuml/experimental/fil/forest_model.hpp @@ -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()