Skip to content

Conversation

@sharwell
Copy link
Contributor

@sharwell sharwell commented Dec 8, 2019

Builds on #4546

@sharwell sharwell mentioned this pull request Dec 8, 2019
@sharwell sharwell changed the title Use std::unique_ptr for objects in LdaEngine WIP Use std::unique_ptr for objects in LdaEngine Dec 8, 2019
@sharwell sharwell force-pushed the unique-ptr-1 branch 3 times, most recently from 2a8b141 to fae0d3c Compare December 8, 2019 01:52
@codecov
Copy link

codecov bot commented Dec 8, 2019

Codecov Report

Merging #4547 into master will decrease coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #4547      +/-   ##
==========================================
- Coverage   75.13%   75.12%   -0.02%     
==========================================
  Files         908      908              
  Lines      160238   160238              
  Branches    17256    17256              
==========================================
- Hits       120401   120379      -22     
- Misses      35016    35043      +27     
+ Partials     4821     4816       -5
Flag Coverage Δ
#Debug 75.12% <ø> (-0.02%) ⬇️
#production 70.51% <ø> (-0.02%) ⬇️
#test 90.31% <ø> (ø) ⬆️
Impacted Files Coverage Δ
...c/Microsoft.ML.FastTree/Utils/ThreadTaskManager.cs 79.48% <0%> (-20.52%) ⬇️
src/Microsoft.ML.AutoML/Sweepers/ISweeper.cs 59.49% <0%> (-7.6%) ⬇️
src/Microsoft.ML.AutoML/Sweepers/Parameters.cs 78.81% <0%> (-4.24%) ⬇️
...rosoft.ML.AutoML/ColumnInference/TextFileSample.cs 59.6% <0%> (-2.65%) ⬇️
...ML.Transforms/Text/StopWordsRemovingTransformer.cs 86.1% <0%> (-0.16%) ⬇️
...soft.ML.Data/DataLoadSave/Text/TextLoaderCursor.cs 85.31% <0%> (+0.6%) ⬆️
....ML.AutoML/PipelineSuggesters/PipelineSuggester.cs 86.55% <0%> (+3.36%) ⬆️

@sharwell sharwell changed the title WIP Use std::unique_ptr for objects in LdaEngine Use std::unique_ptr for objects in LdaEngine Dec 8, 2019
@sharwell sharwell marked this pull request as ready for review December 8, 2019 17:43
@sharwell sharwell requested a review from a team as a code owner December 8, 2019 17:43
data_block_.reset(nullptr);
atomic_stats_.reset(nullptr);
model_block_.reset(nullptr);
samplerQueue_.reset(nullptr);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 These calls to reset are likely not required, but by including them it ensures the objects are destroyed in the same order the old code destroyed them.

model_block_.reset(new LDAModelBlock());
data_block_.reset(new LDADataBlock(num_threads_));
process_barrier_.reset(new SimpleBarrier(num_threads_));
samplerQueue_.reset(new CBlockedIntQueue());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Using reset instead of std::make_shared because some of the builds only have C++ 11 (the latter is C++ 14).

@sharwell sharwell merged commit 9a1fd8b into dotnet:master Dec 8, 2019
@sharwell sharwell deleted the unique-ptr-1 branch December 8, 2019 20:45
@ghost ghost locked as resolved and limited conversation to collaborators Mar 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants