forked from NVIDIA/NVFlare
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
596016b
commit 91602e8
Showing
10 changed files
with
646 additions
and
422 deletions.
There are no files selected for viewing
630 changes: 312 additions & 318 deletions
630
integration/xgboost/encryption_plugins/cuda_plugin/src/cuda_ct_plugin.h
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
integration/xgboost/encryption_plugins/shared/include/timer.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright (c) 2024, NVIDIA CORPORATION. All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef TIMER_H | ||
#define TIMER_H | ||
|
||
#include <chrono> | ||
|
||
class Timer { | ||
public: | ||
Timer() : start_time_(), end_time_() { | ||
begin_time_ = std::chrono::high_resolution_clock::now(); | ||
} | ||
|
||
void start() { | ||
start_time_ = std::chrono::high_resolution_clock::now(); | ||
} | ||
|
||
void stop() { | ||
end_time_ = std::chrono::high_resolution_clock::now(); | ||
} | ||
|
||
double duration() const { | ||
return std::chrono::duration_cast<std::chrono::microseconds>(end_time_ - start_time_).count(); | ||
} | ||
|
||
double now() { | ||
return std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock::now() - begin_time_).count(); | ||
} | ||
|
||
private: | ||
std::chrono::high_resolution_clock::time_point begin_time_; | ||
std::chrono::high_resolution_clock::time_point start_time_; | ||
std::chrono::high_resolution_clock::time_point end_time_; | ||
}; | ||
|
||
#endif // TIMER_H |
Oops, something went wrong.