大佬教程收集整理的这篇文章主要介绍了c – 是否可以锁定CPU缓存中的某些数据?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
[编辑 – 复制自Alex添加的答案]
double* array1 = new double[1000000]; // this array has elements unsigned long* array2 = unsigned long[300]; double varX,t,sum=0; int iter=0,i=0; while(i<=max_steps) { varX+=difX; nm0 = int(varX); if(nm1!=nm0) { array2[iter] = nm0; // if you comment this String application works more then 2 times faster :) nm1=nm0; t = array1[nm0]; // if you comment this String,there is almost no change in time ++iter; } sum+=t; ++i; }
首先,我要感谢你们所有人的回答.实际上,不放置代码有点蠢.所以我现在决定这样做.
double* array1 = new double[1000000]; // this array has elements unsigned long* array2 = unsigned long[300]; double varX,there is almost no change in time ++iter; } sum+=t; ++i; }
就是这样.如果有人有任何想法会很好.再一次非常感谢你.
诚挚
亚历克斯
以上是大佬教程为你收集整理的c – 是否可以锁定CPU缓存中的某些数据?全部内容,希望文章能够帮你解决c – 是否可以锁定CPU缓存中的某些数据?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。