diff options
author | Manjunath Kudlur <keveman@gmail.com> | 2015-11-06 16:27:58 -0800 |
---|---|---|
committer | Manjunath Kudlur <keveman@gmail.com> | 2015-11-06 16:27:58 -0800 |
commit | f41959ccb2d9d4c722fe8fc3351401d53bcf4900 (patch) | |
tree | ef0ca22cb2a5ac4bdec9d080d8e0788a53ed496d /tensorflow/stream_executor/plugin.cc |
TensorFlow: Initial commit of TensorFlow library.
TensorFlow is an open source software library for numerical computation
using data flow graphs.
Base CL: 107276108
Diffstat (limited to 'tensorflow/stream_executor/plugin.cc')
-rw-r--r-- | tensorflow/stream_executor/plugin.cc | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tensorflow/stream_executor/plugin.cc b/tensorflow/stream_executor/plugin.cc new file mode 100644 index 0000000000..8ca8ecff38 --- /dev/null +++ b/tensorflow/stream_executor/plugin.cc @@ -0,0 +1,40 @@ +#include "tensorflow/stream_executor/plugin.h" + +namespace perftools { +namespace gputools { + +// Mostly-arbitrary ID only used as a sentinel "not otherwise initialized" +// value. This value should never [need to] be specified aside by initialization +// functions defined in this file and in PluginRegistry. +PLUGIN_REGISTRY_DEFINE_PLUGIN_ID(PluginConfig::kDefault); + +PluginConfig::PluginConfig() + : blas_(kDefault), dnn_(kDefault), fft_(kDefault), rng_(kDefault) {} + +bool PluginConfig::operator==(const PluginConfig& rhs) const { + return blas_ == rhs.blas_ && dnn_ == rhs.dnn_ && fft_ == rhs.fft_ && + rng_ == rhs.rng_; +} + +PluginConfig& PluginConfig::SetBlas(PluginId blas) { + blas_ = blas; + return *this; +} + +PluginConfig& PluginConfig::SetDnn(PluginId dnn) { + dnn_ = dnn; + return *this; +} + +PluginConfig& PluginConfig::SetFft(PluginId fft) { + fft_ = fft; + return *this; +} + +PluginConfig& PluginConfig::SetRng(PluginId rng) { + rng_ = rng; + return *this; +} + +} // namespace gputools +} // namespace perftools |