1 /* Copyright 2015 The TensorFlow Authors. All Rights Reserved. 2 3 Licensed under the Apache License, Version 2.0 (the "License"); 4 you may not use this file except in compliance with the License. 5 You may obtain a copy of the License at 6 7 http://www.apache.org/licenses/LICENSE-2.0 8 9 Unless required by applicable law or agreed to in writing, software 10 distributed under the License is distributed on an "AS IS" BASIS, 11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 See the License for the specific language governing permissions and 13 limitations under the License. 14 ==============================================================================*/ 15 16 #include "tensorflow/stream_executor/plugin.h" 17 18 namespace stream_executor { 19 20 // Mostly-arbitrary ID only used as a sentinel "not otherwise initialized" 21 // value. This value should never [need to] be specified aside by initialization 22 // functions defined in this file and in PluginRegistry. 23 PLUGIN_REGISTRY_DEFINE_PLUGIN_ID(PluginConfig::kDefault); 24 PluginConfig()25PluginConfig::PluginConfig() 26 : blas_(kDefault), dnn_(kDefault), fft_(kDefault), rng_(kDefault) {} 27 operator ==(const PluginConfig & rhs) const28bool PluginConfig::operator==(const PluginConfig& rhs) const { 29 return blas_ == rhs.blas_ && dnn_ == rhs.dnn_ && fft_ == rhs.fft_ && 30 rng_ == rhs.rng_; 31 } 32 SetBlas(PluginId blas)33PluginConfig& PluginConfig::SetBlas(PluginId blas) { 34 blas_ = blas; 35 return *this; 36 } 37 SetDnn(PluginId dnn)38PluginConfig& PluginConfig::SetDnn(PluginId dnn) { 39 dnn_ = dnn; 40 return *this; 41 } 42 SetFft(PluginId fft)43PluginConfig& PluginConfig::SetFft(PluginId fft) { 44 fft_ = fft; 45 return *this; 46 } 47 SetRng(PluginId rng)48PluginConfig& PluginConfig::SetRng(PluginId rng) { 49 rng_ = rng; 50 return *this; 51 } 52 53 } // namespace stream_executor 54