1 /* Copyright 2018 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/gpu/gpu_kernel.h" 17 18 namespace stream_executor { 19 namespace gpu { 20 GetGpuCacheConfig() const21hipFuncCache_t GpuKernel::GetGpuCacheConfig() const { 22 switch (preferred_cache_config_) { 23 case KernelCacheConfig::kNoPreference: 24 return hipFuncCachePreferNone; 25 case KernelCacheConfig::kPreferShared: 26 return hipFuncCachePreferShared; 27 case KernelCacheConfig::kPreferL1: 28 return hipFuncCachePreferL1; 29 case KernelCacheConfig::kPreferEqual: 30 return hipFuncCachePreferEqual; 31 default: 32 LOG(FATAL) << "Unknown KernelCacheConfig" 33 << static_cast<int32>(preferred_cache_config_); 34 } 35 } 36 37 } // namespace gpu 38 } // namespace stream_executor 39