-
Notifications
You must be signed in to change notification settings - Fork 174
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
feat: Cuda Plugin Improvements, master branch (2020.08.26.) #398
Merged
robertlangenberg
merged 8 commits into
acts-project:master
from
krasznaa:cuda-improvements-20200826
Oct 13, 2020
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
fc1f7a0
Made the CUDA seed finding process triplets for multiple middle space…
krasznaa 367748b
Taught the unit test about some of the new plugin features.
krasznaa bb8d842
Merge branch 'master' into cuda-improvements-20200826
asalzburger fc1c88f
Merge branch 'master' into cuda-improvements-20200826
asalzburger 48a4c25
Merge branch 'master' into cuda-improvements-20200826
paulgessinger b51e9dd
Updated Acts::Cuda::SeedFinder to allow the user to give it a custom …
krasznaa 6f08696
Added an explicit specification for which CUDA device should be used.
krasznaa 4345ec3
Merge branch 'master' into cuda-improvements-20200826
robertlangenberg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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,73 @@ | ||
// This file is part of the Acts project. | ||
// | ||
// Copyright (C) 2020 CERN for the benefit of the Acts project | ||
// | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
#pragma once | ||
|
||
// System include(s). | ||
#include <iosfwd> | ||
#include <string> | ||
#include <vector> | ||
|
||
namespace Acts { | ||
namespace Cuda { | ||
|
||
/// Class providing information about the CUDA devices at runtime | ||
/// | ||
/// Without exposing any CUDA dependencies publicly to the clients. | ||
/// | ||
class Info { | ||
public: | ||
/// @name Declarations preventing any copies of the singleton object | ||
/// @{ | ||
|
||
/// Explicitly delete the copy constructor | ||
Info(const Info&) = delete; | ||
/// Explicitly delete the move constructor | ||
Info(Info&&) = delete; | ||
|
||
/// Explicitly delete the copy assignment operator | ||
Info& operator=(const Info&) = delete; | ||
/// Explicitly delete the move assignment operator | ||
Info& operator=(Info&&) = delete; | ||
|
||
/// @} | ||
|
||
/// Singleton accessor function | ||
static Info& instance(); | ||
|
||
/// Helper struct describing one available CUDA device | ||
struct Device { | ||
/// Identifier that CUDA knows this device by | ||
int id = -1; | ||
/// The name of this device | ||
std::string name; | ||
/// The maximal number of threads per block for this device | ||
int maxThreadsPerBlock = -1; | ||
/// Whether the device supports multiple kernel executions in parallel | ||
bool concurrentKernels = false; | ||
/// The total amount of (global) memory on the device | ||
std::size_t totalMemory = 0; | ||
}; // struct Device | ||
|
||
/// Get all the available CUDA devices | ||
const std::vector<Device>& devices() const; | ||
|
||
private: | ||
/// The constructor is private to implement the singleton behaviour | ||
Info(); | ||
|
||
/// Information about all available devices | ||
std::vector<Device> m_devices; | ||
|
||
}; // class Info | ||
|
||
/// Print operator for @c Acts::Cuda::Info::Device | ||
std::ostream& operator<<(std::ostream& out, const Info::Device& device); | ||
|
||
} // namespace Cuda | ||
} // namespace Acts |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you consider accepting a logger instance here, and storing as a member variable? You can then default it to
Acts::getDefaultLogger
. This way, other logging backends (like then Athena logging for example) can potentially be passed in.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing. I'll do that later today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you look around, the pattern we usually use is accept an
std::unique_ptr<Logger>
, store as a member, and then provide aconst Logger& logger()
method that the macros call. But I'm sure you figured that out anyway 😉There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Please have a look. 😄