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

Remove the use of dmlc object registry #288

Merged
merged 4 commits into from
Jul 11, 2021

Conversation

hcho3
Copy link
Collaborator

@hcho3 hcho3 commented Jul 9, 2021

Extracted from #285.

  • Do not use the header dmlc/registry.h.
  • Do not use the object registry provided by dmlc-core. The registry lets you instantiate a new object by the class name. We really don't need the registry, since there are only two kinds of code generators (FailSafeCompiler and ASTNativeCompiler). Simple if / else statements suffice.
  • Use pimpl pattern to hide templated functions in the code generators.
  • Define new headers failsafe.h and ast_native.h to store the class declarations of FailSafeCompiler and ASTNativeCompiler. This is more in line with conventional C++.
  • Rename param to param_.

@codecov
Copy link

codecov bot commented Jul 9, 2021

Codecov Report

Merging #288 (2eb3565) into mainline (262f782) will increase coverage by 0.02%.
The diff coverage is 77.33%.

Impacted file tree graph

@@              Coverage Diff               @@
##             mainline     #288      +/-   ##
==============================================
+ Coverage       84.99%   85.02%   +0.02%     
  Complexity         46       46              
==============================================
  Files             103      105       +2     
  Lines            7959     7958       -1     
  Branches           50       50              
==============================================
+ Hits             6765     6766       +1     
+ Misses           1169     1167       -2     
  Partials           25       25              
Impacted Files Coverage Δ
include/treelite/compiler.h 100.00% <ø> (ø)
src/compiler/compiler.cc 96.22% <66.66%> (-0.14%) ⬇️
src/compiler/failsafe.cc 87.90% <66.66%> (+0.46%) ⬆️
src/compiler/ast_native.cc 96.34% <90.32%> (+0.20%) ⬆️
src/compiler/ast_native.h 100.00% <100.00%> (ø)
src/compiler/failsafe.h 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 262f782...2eb3565. Read the comment docs.

src/compiler/failsafe.h Show resolved Hide resolved
src/compiler/failsafe.cc Show resolved Hide resolved
@hcho3 hcho3 merged commit e99ca01 into dmlc:mainline Jul 11, 2021
@hcho3 hcho3 deleted the remove_dmlc_obj_registry branch July 11, 2021 11:58
@hcho3 hcho3 mentioned this pull request Jul 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants