I wanted to write an CUDA code where I could see firsthand the benefits that CUDA offered for speeding up applications. Here is is a CUDA code I have written using Thrust ( http://code.google.com/p/thrust/ ) Briefly, all that the code does is create two 2^23 length integer vectors,one on the host and one on the device identical to each other, and sorts them. It also (attempts to) measure tim
我想写一个CUDA代码,我可以直接看到CUDA为加速应用程序所提供的好处。 以下是我使用Thrust编写的CUDA代码(http://code.google.com/p/thrust/) 简而言之,代码所做的就是创建两个2 ^ 23长度的整数向量,一个在主机上,另一个在设备上相互相同,然后对它们进行排序。 它也(尝试)为每个测量时间。 在主机载体上,我使用std::sort 。 在设备向量上,我使用thrust::sort 。 对于我使用的编译 nvcc sortcompare.cu -l
Possible Duplicate: Modifying value of char pointer in c produces segfault This is a piece of code ... void main() { char *p="Hello"; *p= 'h'; // Segmentation fault . } I understand the fact that there is a segmentation fault and it gives me a run time error also .But I wonder , why is it a RUN TIME ERROR ?? Why cant the compiler tell me before executing the pr
可能重复: 在c中修改char指针的值会产生段错误 这是一段代码... void main() { char *p="Hello"; *p= 'h'; // Segmentation fault . } 我知道有一个分段错误,它也给我一个运行时错误。但我想知道,为什么它是一个运行时错误? 为什么编译器在执行程序之前无法告诉我? 为什么它不显示编译时间错误? PS:我使用Visual C ++ 2005 Express .. 字符串文字实际上是char const*类型的。
I want to develop c++ programs on mac os and I have installed Xcode with a bunch of frameworks. However I would like to write code without Xcode IDE but just write my own makefile and directly compile/link with gcc (shipped with Xcode). Take a opengl program as example I tried to compile it with the command gcc -I/usr/include/ -I/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/GLU
我想在mac os上开发c ++程序,并且我已经用一堆框架安装了Xcode。 不过,我想编写没有Xcode IDE的代码,但只需编写自己的makefile并直接编译/链接到gcc(随Xcode一起提供)。 以一个opengl程序为例 我试图用命令编译它 gcc -I / usr / include / -I / Developer / SDKs / MacOSX10.6.sdk / System / Library / Frameworks / GLUT.framework / Headers / -I / Developer / SDKs / MacOSX10.6.sdk / System / Library / Fr
I'm trying to reduce the size of my elf executable. I'm compiling with -ffunction-sections -fdata-sections and linking with -gc-sections , but it appears some of the symbols that I believe are unused are not being discarded. Is there some command in the GNU toolchain I can run to find out which symbols are being used and where? Toolchain: GNU arm-none-eabi Platform: Cortex-M4 Lan
我试图减小我的elf可执行文件的大小。 我正在用-ffunction-sections -fdata-sections和-fdata-sections链接进行-gc-sections ,但似乎我认为一些未使用的符号不会被丢弃。 在GNU工具链中是否有一些命令可以运行以找出哪些符号正在使用以及在哪里? 工具链:GNU arm-none-eabi 平台:Cortex-M4 语言:C ++ 这里是我典型的构建标志: 编译: arm-none-eabi-g++.exe -Wall -O3 -mthumb -std=c++11 -mcpu=cortex-m4 -mf
I have a problem about cross compile. #include <stdio.h> int main() { printf("hellon"); return 0; } this is a simple hello world code I used. I'm using arm-none-eabi-g++, downloaded from mentor graphics. Here is the error. I don't know what lib is missed. /home/kang/Utils/arm-2013.05/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld: warning: cannot
我有一个关于交叉编译的问题。 #include <stdio.h> int main() { printf("hellon"); return 0; } 这是我用过的一个简单的hello世界代码。 我使用arm-none-eabi-g ++,从指导图形下载。 这是错误。 我不知道错过了什么。 /home/kang/Utils/arm-2013.05/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld: warning: cannot find entry symbol _start; defaulting to 00008018 /home/kang
I use ./configure command to generate a makefile. My compiler is arm-fsl-linux-gnueabi toochain. When I ran ./configure, I got the following problem: tl@tl-virtual-machine:~/Desktop/mvux_camera/demo/sampli_save_demo$ ./configure --host=/home/tl/Desktop/opt/Embedsky/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/tq-linaro-toolchain/bin/arm-fsl-linux-gnueabi-g++ configure: WARNING: if you wanted
我使用./configure命令来生成一个makefile。 我的编译器是arm-fsl-linux-gnueabi toochain。 当我运行./configure时,出现以下问题: tl -tl-virtual-machine:〜/ Desktop / mvux_camera / demo / sampli_save_demo $ ./configure --host = / home / tl / Desktop / opt / Embedsky / gcc-4.6.2-glibc-2.13-linaro-multilib- 2011.12 / tq-linaro-toolchain / bin / arm-fsl-linux-gnueabi -g ++ configure:警告:如果你想
There are various ways to cross-compile to Raspberry Pi, and there are also solutions posted for cross-compiling Qt or opencv. However, I couldn't find any solution to cross-compile a program with Qt which also uses opencv. I tried the following, using debian on a 64-bit PC: I compiled and set up Qt as a cross-compiler to ARM7, using this tutorial. It didn't work without issues tho
有多种方式可以交叉编译到Raspberry Pi,并且还有用于交叉编译Qt或opencv的解决方案。 然而,我找不到任何解决方案与使用opencv的Qt交叉编译程序。 我尝试了以下方法,在64位PC上使用debian: 我使用本教程编译并设置了Qt作为ARM7的交叉编译器。 它没有工作没有问题,虽然,这是我发布的答案,它为我解决了。 我现在可以在Raspberry Pi上使用图形化GUI来运行我的Qt程序(尽管只是全屏,但这是一个完全不同的问题) 我
When I compile a c++ file that includes a precompiled header, everything works as expected // test.c++ #include <precompiled.h> #include <header.h> main() {} > g++-4.7 --std=c++11 BLAH... test.c++ -H 2>&1 | grep precompiled.h ! precompiled.h.gch (! means that gcc found and used the precompiled header) However, when I put #include < precompiled.h > into header.h, i
当我编译包含预编译头文件的c ++文件时,一切都按预期工作 // test.c++ #include <precompiled.h> #include <header.h> main() {} > g++-4.7 --std=c++11 BLAH... test.c++ -H 2>&1 | grep precompiled.h ! precompiled.h.gch (!表示gcc找到并使用了预编译头文件) 但是,当我将#include <precompiled.h>放入header.h中时,它不起作用: // test.c++ #include <header.h> main() {} &
I use ubuntu 12.04, my Makefile FC:gfortran, but I couldn't compile, I checked on it, it installed(my gcc upgraded from 4.6.3 to 4.7) How do I link to it? I tried pkg-config --cflags --lib gfortran or gtkxxx, it says not in the pkg_config_path I checked gfortran: COLLECT_GCC=gfortran COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper Target: x86_64-linux-gnu Configured with
我使用ubuntu 12.04,我的Makefile FC:gfortran,但是我无法编译,我检查了它,它安装了(我的gcc从4.6.3升级到4.7)我如何链接到它? 我试过pkg-config --cflags --lib gfortran或者gtkxxx,它说不在pkg_config_path中 我检查了gfortran:COLLECT_GCC = gfortran COLLECT_LTO_WRAPPER = / usr / lib / gcc / x86_64-linux-gnu / 4.6 / lto-wrapper目标:x86_64-linux-gnu配置:../src/configure -v --with-pkgversion =
I am attempting to get cross-compiling for Raspberry Pi working on my Ubuntu machine. During my initial attempts I was using the arm-linux-gnueabi compiler, which is available in the Ubuntu repo. I got this working. I was able to build all my dependencies and use the cross-compiler in my cmake project. However, I believe I should be using the hf version, so I switched to arm-linux-gnueabihf
我正在尝试为我的Ubuntu机器上的Raspberry Pi进行交叉编译。 在我最初的尝试中,我使用了arm-linux-gnueabi编译器,它可以在Ubuntu repo中找到。 我得到了这个工作。 我能够构建我所有的依赖关系,并在我的cmake项目中使用交叉编译器。 但是,我相信我应该使用hf版本,所以我切换到了arm-linux-gnueabihf。 然后我意识到这不适用于Raspberry Pi,因为它是armv6。 在Google搜索之后,我发现了GitHub的预建工具链:https