上一页 1 ··· 9 10 11 12 13
摘要: const容易混乱的地方在于底层const和顶层const概念。以及const与新标准中constexpr的区分。 顶层const和底层const int *const p1 = &i; // 顶层 cosnt int ci = 42; // 顶层 const int *p2 = &ci; //底层 阅读全文
posted @ 2021-10-20 11:52 ijpq 阅读(31) 评论(0) 推荐(0) 编辑
摘要: 假设A为3x4,B为4x3 physical structure A[0,1,2,...,11];B[0,...,11] logical structure A[0,1,2,3] A[4,5,6,7] A[8,9,10,11] B[0,1,2] B[3,4,5] B[6,7,8] B[9,10,11 阅读全文
posted @ 2021-10-20 11:52 ijpq 阅读(67) 评论(0) 推荐(0) 编辑
摘要: https://stackoverflow.com/questions/4162456/forward-declaration-of-classes?rq=1 class Base: pass # subs = [Sub3,Sub1] # Note that this is NOT a list o 阅读全文
posted @ 2021-10-14 14:57 ijpq 阅读(509) 评论(0) 推荐(0) 编辑
摘要: % x%y语义上:如果x和y都是正整数,结果是x除以y的余数 这个运算结果的取值范围是[0, x-1]  但值得注意的是 // Program to illustrate the // working of the modulo operator #include <stdio.h> int m 阅读全文
posted @ 2021-10-14 08:53 ijpq 阅读(32) 评论(0) 推荐(0) 编辑
摘要: overview 这是ECE408的一个作业,目标是实现3d卷积. 测试的时候使用link这个脚本对测试数据测试 课程给的测试环境是GTX1080.我用自己的RTX2070会出bug.而实验室服务器的titan xp是可以的 这个问题分为两种写法,目前只实现了一种相对好理解但效率低的写法。我认为效 阅读全文
posted @ 2021-10-14 08:52 ijpq 阅读(664) 评论(0) 推荐(0) 编辑
摘要: 这一天的面试值得记录一下 算法题是leetcode 1214 这个题目我首先写了一个nlogn的算法,在左边树上迭代,右边树上查找目标值 接下来的问题是,如何进行优化? 显然nlogn的下一个目标是n.因为nlogn在常数级上已经没有优化空间了 然后n的方法我起初看着两颗树是没有想到的,后来还是 阅读全文
posted @ 2021-10-14 08:50 ijpq 阅读(109) 评论(2) 推荐(0) 编辑
摘要: PartA PartA1 using pointer to pointer impl 2D array int **pp = malloc(sizeof(int*)*row); for (int i =0;i < col;i++) pp[i] = malloc(sizeof(int)*col); t 阅读全文
posted @ 2021-10-14 08:49 ijpq 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 今天看pytorch源码,看到一些之前和DALI源码相似的操作,我发现这些代码都使用C来实现范型,而不使用C++.真的很神奇!难道嫌模板编译不够快???? 假如我们写了一个整数add的函数如下 struct NumVector { num *data; int n; } // C = A + B v 阅读全文
posted @ 2021-10-14 08:49 ijpq 阅读(106) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13