llvm

TVM安装

大憨熊 提交于 2020-02-16 14:35:06
为什么选择TVM 为提升深度学习模型的推理效率,设备平台制造商针对自己的平台推出优化的推理引擎,例如NAVIDA的tensorRT,Intel的OpenVINO,Tencent针对移动端应用推出NCNN等。目前,深度学习模型应用广泛,在服务端和移动端都有应用,甚至于特殊的嵌入式场景想,它们都有加速模型推理的需求。   TVM介是从深度学习编译器的角度来做推理引擎,目前技术领域还比较新,具体技术细节以后有机会会深入学习,这里主要想体验一下使用TVM做深度模型推理,重点是推理效率的提升,所以尝试安装下TVM测试下。 相关版本 ```bash gcc版本 6.4.0 cmake 3.16.4 llvm 我选择的版本为llvm-9.0.0 ``` gcc 安装 查看系统版本 cat /etc/redhat-release 查看默认的gcc版本 gcc --version 查看默认动态库 strings /usr/lib64/libstdc++.so.6 | grep GLIBC GLIBCXX_3.4 GLIBCXX_3.4.1 GLIBCXX_3.4.2 GLIBCXX_3.4.3 GLIBCXX_3.4.4 GLIBCXX_3.4.5 GLIBCXX_3.4.6 GLIBCXX_3.4.7 GLIBCXX_3.4.8 GLIBCXX_3.4.9 GLIBCXX_3.4.10

Is there a way to omit the definitions (line markers) at the top of the C-preprocessor output?

痞子三分冷 提交于 2020-02-15 07:11:13
问题 If I process the following test.def input file with gcc -C -x c -E test.def : #define TEST foo int TEST; I would like the output to be just: int foo; Instead I get: # 1 "test.def" # 1 "<built-in>" # 1 "<command-line>" # 1 "test.def" int foo; Is there a way I can omit those extra lines at the top? 回答1: These are not just on the top - but instead they're the line markers that the C preprocessors use to convey the source code positions where certain lines come from, to the C compiler. With GCC

微信团队分享:极致优化,iOS版微信编译速度3倍提升的实践总结

不羁岁月 提交于 2020-02-13 06:21:40
1、引言 岁月真是个养猪场,这几年,人胖了,微信代码也翻了。 记得 14 年转岗来微信时,用自己笔记本编译微信工程才十来分钟。如今用公司配的 17 年款 27-inch iMac 编译要接近半小时;偶然间更新完代码,又莫名其妙需要全新编译。在这么低的编译效率下,开发心情受到严重影响。 于是年初我向上头请示,优化微信编译效率,上头也同意了。 2、现有方案 在动手之前,先搜索目前已有方案,大概情况如下。 2.1 优化工程配置 1)将 Debug Information Format 改为 DWARF: Debug 时是不需要生成符号表,可以检查一下子工程(尤其开源库)有没有设置正确。 2)将 Build Active Architecture Only 改为 Yes: Debug 时是不需要生成全架构,可以检查一下子工程(尤其开源库)有没有设置正确。 3)优化头文件搜索路径: 避免工程 Header Search Paths 设置了路径递归引用: Xcode 编译源文件时,会根据 Header Search Paths 自动添加 -I 参数,如果递归引用的路径下子目录越多,-I 参数也越多,编译器预处理头文件效率就越低,所以不能简单的设置路径递归引用。同样 Framework Search Paths 也类似处理。 2.2 使用 CocoaPods 管理第三方库 这是业界常用的做法

解决 LLVM 错误提示 may only occur zero or one times!

廉价感情. 提交于 2020-02-10 04:57:18
使用 LLVM 混淆器添加参数进行编译提示如下错误: clang (LLVM option parsing): for the -bcf option: may only occur zero or one times! 将编译参数全部复制下来,仔细对比发现,有重复的 -DINIT_SCRIPTING_BACKEND=1 -mllvm -bcf -fno-strict-overflow -DINIT_SCRIPTING_BACKEND=1 -mllvm -bcf 于是再查看 Xcode 的 CFlag 配置,发现有一个 $(inherited) 参数,删除这个参数就可以了。 原文地址: https://www.exchen.net/%E8%A7%A3%E5%86%B3-llvm-%E9%94%99%E8%AF%AF%E6%8F%90%E7%A4%BA-may-only-occur-zero-or-one-times.html 来源: https://www.cnblogs.com/exchen/p/10203597.html

Linux 7上使用源码编译安装PostgreSQL和生成RPM安装包

北城余情 提交于 2020-02-08 09:40:14
原创文章,转载须注明出处。访问我的Github(地址: https://guobo507.github.io )查看最新文章列表。 目录 编译和安装PostgreSQL 创建PostgreSQL RPM安装包 PGDG 中提供了针对多个系统版本都提供了多个版本的 PostgreSQL 的 RPM 安装包,在生产中使用PGDG安装PostgreSQL数据库软件包是非常方便的途径。 在如今国产化、自主可控的浪潮之下,很多时候我们想要在国产的平台、(所谓)国产的操作系统中使用PostgreSQL数据库,大多数时候系统中自带的PostgreSQL版本很可能不符合我们的要求。因此,本文的目的是演示如何在指定平台上编译安装想要的 PostgreSQL 版本?如何使用 PG 源代码在指定的硬件平台上创建该平台专用的 PostgreSQL 的 RPM 安装包? 编译和安装PostgreSQL 本文讨论的是针对RedHat系列Linux(我是用的是 CentOS 7)上的实践,使用的平台也是 x86_64 平台。虽然在该平台可以直接从 PGDG 进行安装,但本文的目的在于演示整个操作的过程。我将以安装PG 12.1版本为例说明。 首先,我的系统环境如下: [root@pgbuild ~]# cat /etc/centos-release CentOS Linux release 7.6.1810

clang: export symbols of implicitly instantiated functions with O3

假装没事ソ 提交于 2020-02-06 05:08:05
问题 TL,DR: How can I force clang to export the symbols of implicitly instantiated functions even when -O3 is active? Let's take the following code: #include <iostream> #include <llvm/Support/DynamicLibrary.h> #include <llvm/ExecutionEngine/ExecutionEngine.h> #include <llvm/ExecutionEngine/RTDyldMemoryManager.h> template <typename T> __attribute__((noinline)) int twice(const T& t) { return t * 2; } int thrice(const int& t) { return t * 3; } int main() { std::cout << twice(5) << std::endl; std:

LLVM version on iOS and Android

六月ゝ 毕业季﹏ 提交于 2020-02-01 05:58:01
问题 How to find out which LLVM version is used in Android NDK and Apple Xcode? Checking clang --version from Android NDK r15c I got: Android clang version 5.0.300080 (based on LLVM 5.0.300080) but NDK r15c was released in July 2017, before actual release of LLVM 5.0 (what happened in September 2017). Does it really use LLVM 5.0? Checking clang --version from Xcode only shows Apple's own LLVM version: Apple LLVM version 9.0.0 (clang-900.0.38) is there any way to find out to which "unpatched" LLVM

LLVM version on iOS and Android

痴心易碎 提交于 2020-02-01 05:56:29
问题 How to find out which LLVM version is used in Android NDK and Apple Xcode? Checking clang --version from Android NDK r15c I got: Android clang version 5.0.300080 (based on LLVM 5.0.300080) but NDK r15c was released in July 2017, before actual release of LLVM 5.0 (what happened in September 2017). Does it really use LLVM 5.0? Checking clang --version from Xcode only shows Apple's own LLVM version: Apple LLVM version 9.0.0 (clang-900.0.38) is there any way to find out to which "unpatched" LLVM

LLVM's integer types

痴心易碎 提交于 2020-01-30 19:54:17
问题 The LLVM language specifies integer types as iN, where N is the bit-width of the integer, and ranges from 1 to 2^23-1 (According to: http://llvm.org/docs/LangRef.html#integer-type) I have 2 questions: When compiling a C program down to LLVM IR level, what types may be lowered to i1, i2, i3, etc? It seems like the types i8, i16, i32, i64 must be enough, so I was wondering what all the other nearly 8 million integer types are for. Is it true that both signed and unsigned integer types are

LLVM's integer types

本小妞迷上赌 提交于 2020-01-30 19:53:08
问题 The LLVM language specifies integer types as iN, where N is the bit-width of the integer, and ranges from 1 to 2^23-1 (According to: http://llvm.org/docs/LangRef.html#integer-type) I have 2 questions: When compiling a C program down to LLVM IR level, what types may be lowered to i1, i2, i3, etc? It seems like the types i8, i16, i32, i64 must be enough, so I was wondering what all the other nearly 8 million integer types are for. Is it true that both signed and unsigned integer types are