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

[CudaMathEngine] SetCudaDevice in copy and convert, minor CBaseLayer optimizing #1036

Merged
merged 2 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
[NeoML] minor optimizations in CBaseLayer
Signed-off-by: Kirill Golikov <kirill.golikov@abbyy.com>
  • Loading branch information
favorart committed Apr 2, 2024
commit d27af04862e53a07da440dd5b0f16f6c3ddf2007
2 changes: 0 additions & 2 deletions NeoML/include/NeoML/Dnn/Dnn.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,6 @@ class NEOML_API CBaseLayer : public virtual IObject {

virtual void OnDnnChanged( CDnn* ) {}

void SetOutputBlob(int num, CDnnBlob* blob);

// Fills with zeros the parameters that are less (but not equal) than a given threshold
virtual void FilterLayerParams( float /*threshold*/ ) {}

Expand Down
4 changes: 2 additions & 2 deletions NeoML/src/Dnn/BaseLayer.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright © 2017-2020 ABBYY Production LLC
/* Copyright © 2017-2024 ABBYY

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -676,7 +676,7 @@ void CBaseLayer::transferDiffBlob( CDnnBlob* diffBlob, int outputNum )
// If an output is connected to several inputs, create a copy of the diff blob and then add it to the others
if(readyOutputDiffs[outputNum] == 0) {
if( outputDiffBlobs[outputNum] == 0 ) {
outputDiffBlobs[outputNum] = cloneBlobForDiff(diffBlob->GetDesc());
outputDiffBlobs[outputNum] = CDnnBlob::CreateBlob( MathEngine(), diffBlob->GetDesc() );
}
outputDiffBlobs[outputNum]->CopyFrom( diffBlob );
} else {
Expand Down