Skip to content

Remove the use of dmlc object registry - #288

Merged
chyunsu3 merged 4 commits into
dmlc:mainlinefrom
chyunsu3:remove_dmlc_obj_registry
Jul 11, 2021
Merged

chyunsu3 merged 4 commits into
dmlc:mainlinefrom
chyunsu3:remove_dmlc_obj_registry

Conversation

@chyunsu3

@chyunsu3 chyunsu3 commented Jul 9, 2021

Copy link
Copy Markdown
Collaborator

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

codecov Bot commented Jul 9, 2021

Copy link
Copy Markdown

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.

Comment thread src/compiler/failsafe.h
Comment thread src/compiler/failsafe.cc
@chyunsu3
chyunsu3 merged commit e99ca01 into dmlc:mainline Jul 11, 2021
@chyunsu3
chyunsu3 deleted the remove_dmlc_obj_registry branch July 11, 2021 11:58
@chyunsu3 chyunsu3 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