發表文章

ECE438@UIUC MP1: OpenSSL Cannot open source file /ssl.h

圖片
问题描述:程序报错如下 解决尝试 【失败】对openssl库的依赖进行补全安装 问题一个可能的因素在于可能openssl库已经安装了,但是一些依赖库并没有得到安装。 参考: https://stackoverflow.com/questions/3016956/how-do-i-install-the-openssl-libraries-on-ubuntu/3016986#3016986 很不幸失败了,最后这个安装并没有将需要用的两个文件写入。 【尝试】VSCode小功能QuickFix的建议 参考: https://stackoverflow.com/questions/45583473/include-errors-detected-in-vscode 然后尝试查找缺失的ssl.h文件在哪里:果不其然并没有出现在任何地方。 果不其然/usr/include也没有任何ssl.h的影子 【成功】根据之前安装命令的提示安装libssl-doc 之前命令中有一个Suggested packages: libssl-doc. 于是进行一波安装: 命令:sudo apt install libssl-doc openssl成功出现在了/usr/include中 最后报错找不到文件的错误消失。

ECE408@UIUC MP5 CUDA C++实现并行计算的Reduction Tree Addition

圖片
ECE408@UIUC CUDA C++实现并行计算的Reduction Tree Addition ECE408@UIUC CUDA C++实现并行计算的Reduction Tree Addition 如何理解Reduction Tree: 一句话概括 :用树形结构实现 多线程的并行化 从而降低 时间复杂度。 Reduction Tree的性质:我们知道 求和一个长度为N的数列怎么的也得进行N-1次加法 , 怎么优化都是进行基于加法的交换/结合定律进行优化。 并行计算设备上实现Reduction Tree的优势: 我们可以同时计算很多路,所以我们可以结合足够多的简单的加法计算实现 很多个相邻元素的相加结合,归并地进行计算 在实际效果上形成了低时间复杂度的一个 树形结构:Reduction Tree,总的时间上从O(N)降低到了O(log(N))。 CUDA C++实现 x int main (){   /* Some launch code..... */   //@@ Initialize the grid and block dimensions here   dim3 DimGrid ( numOutputElements , 1 , 1 );   dim3 DimBlock ( BLOCK_SIZE , 1 , 1 );       //@@ Launch the GPU Kernel here   total <<< DimGrid , DimBlock >>> ( deviceInput , deviceOutput , numInputElements );   cudaDeviceSynchronize ();   cudaMemcpy ( hostOutput , deviceOutput , numOutputElements * sizeof ( float ), cudaMemcpyDeviceToHost );     /********************************************************...

ECE438@UIUC WSL中的VSCode C/C++编译环境出错

圖片
  ECE438@UIUC WSL中的VSCode C/C++编译环境出错 问题描述:Compile Path出错,VSCode无法找到标准库文件 问题尝试解决的过程: WSL中C++/C编译器默认放在: 问题尝试:官方文档 网址: https://code.visualstudio.com/docs/cpp/config-wsl 文档建议:寻找gcc和g++的位置。 【失败】尝试查找gcc的路径,g++不存在,gcc不是文件,只是一个壳。 【成功】尝试执行自动更新把gcc和gdb装上 问题成功解决。

ECE408@UIUC 报错free(): invalid next size (normal)解决

圖片
问题背景:ECE408 Project实现一个串行的CNN卷积层 ECE408@UIUC 并行编程 C++报错free(): invalid next size (normal)解决 问题背景:ECE408 Project实现一个串行的CNN卷积层 需要实现一个串行的实现达到教育我们串行跑CNN是一个时间非常长没有训练效率的东西(雾) 实现代码思路是纯串行:(以下是buggy version) ​ x void conv_forward_cpu(float *output, const float *input, const float *mask, const int B, const int M, const int C, const int H, const int W, const int K, const int S) { /*   Modify this function to implement the forward pass described in Chapter 16.   The code in 16 is for a single image.   We have added an additional dimension to the tensors to support an entire mini-batch   The goal here is to be correct, not fast (this is the CPU implementation.)   Function paramters:   output - output   input - input   k - kernel   B - batch_size (number of images in x)   M - number of output feature maps   C - number of input feature maps   H - input height dimension   W - input width dimension ...