aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/stream_executor/plugin.cc
blob: 8ca8ecff382936545022da41bb1b2a2a2918354e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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