version.cc 1.4 KB
Newer Older
X
clean  
Xin Pan 已提交
1
/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
X
version  
Xin Pan 已提交
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */

#include "paddle/fluid/framework/version.h"
#include <algorithm>

namespace paddle {
namespace framework {
X
refine  
Xin Pan 已提交
20
bool IsProgramVersionSupported(int64_t version) {
X
version  
Xin Pan 已提交
21 22 23 24 25 26
  static int num_supported =
      sizeof(kSupportedProgramVersion) / sizeof(kSupportedProgramVersion[0]);
  return std::find(kSupportedProgramVersion,
                   kSupportedProgramVersion + num_supported,
                   version) != kSupportedProgramVersion + num_supported;
}
X
refine  
Xin Pan 已提交
27 28 29 30 31 32 33 34

bool IsTensorVersionSupported(uint32_t version) {
  static int num_supported =
      sizeof(kSupportedTensorVersion) / sizeof(kSupportedTensorVersion[0]);
  return std::find(kSupportedTensorVersion,
                   kSupportedTensorVersion + num_supported,
                   version) != kSupportedTensorVersion + num_supported;
}
X
version  
Xin Pan 已提交
35 36
}  // namespace framework
}  // namespace paddle