[PATCH] Drop dependency on source repository hash
authorNobuhiro Iwamatsu <iwamatsu@debian.org>
Wed, 3 Aug 2022 05:00:47 +0000 (14:00 +0900)
committerNobuhiro Iwamatsu <iwamatsu@debian.org>
Sat, 6 Aug 2022 00:37:17 +0000 (01:37 +0100)
target_factory uses a hash of the top commit of the repository as
library id. As this id depends on the repository / branch it is not
stable; a version number should be used to represent library API
version if required.

As the library id is only used in the test, drop this function from
the library interface.

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@debian.org>
Gbp-Pq: Name 0001-Drop-dependency-on-source-repository-hash.patch

include/vitis/ai/target_factory.hpp
src/target_factory.cpp
test/test_lib_info.cpp

index a6728b6ed9c56b1a815786e73944902c8bc26f28..23a3bf3c56bc1abec5f4e0ccab38d22eae8f6c7b 100644 (file)
@@ -49,7 +49,6 @@ class TARGET_FACTORY_DLLESPEC TargetFactory {
   virtual void dump(const Target& target, const std::string& file) const = 0;
   virtual bool is_registered_target(const std::string& name) const = 0;
   static const std::string get_lib_name();
-  static const std::string get_lib_id();
 
  public:
   virtual ~TargetFactory() = default;
index eca9bfad2008ef445d0ca2fc11899ce2a36ce087..1268e0a4ac80d79628612db5aed5cc6891ff5c8a 100644 (file)
@@ -233,10 +233,5 @@ const std::string TargetFactory::get_lib_name() {
   return ret;
 }
 
-const std::string TargetFactory::get_lib_id() {
-  const auto ret = std::string{PROJECT_GIT_COMMIT_ID};
-  return ret;
-}
-
 }  // namespace ai
 }  // namespace vitis
index 8b78591b34642fad2fd52e93226dfa195cea9cd3..2802fe24658203e1bea8dea93a0a00e970dd83e6 100644 (file)
@@ -24,7 +24,6 @@ int main(int, char* argv[]) {
                   UNI_LOG_STD_LEVEL_INFO);
 
   UNI_LOG_INFO << "lib_name = " << TargetFactory::get_lib_name();
-  UNI_LOG_INFO << "lib_id = " << TargetFactory::get_lib_id();
 
   return 0;
 }