资源简介
自己写的csapp上的性能优化实验的kernels.c。
代码片段和文件信息
/********************************************************
* Kernels to be optimized for the CS:APP Performance Lab
********************************************************/
#include
#include
#include “defs.h“
/*
* Please fill in the following team struct
*/
team_t team = {
“5120379091“ /* Student ID */
“Gao Ce“ /* Your Name */
“gaoce270863799@se.sjtu.edu.cn“ /* First member email address */
““ /* Second member full name (leave blank if none) */
““ /* Second member email addr (leave blank if none) */
};
/***************
* ROTATE KERNEL
***************/
/******************************************************
* Your different versions of the rotate kernel go here
******************************************************/
/*
*Add the description of your Rotate implementation here!!!
*1. Brief Intro of method
*2. CPE Achieved
*3. other words
*/
/*
* naive_rotate - The naive baseline version of rotate
*/
char naive_rotate_descr[] = “naive_rotate: Naive baseline implementation“;
void naive_rotate(int dim pixel *src pixel *dst)
{
int i j;
for (i = 0; i < dim; i++)
for (j = 0; j < dim; j++)
dst[RIDX(dim-1-j i dim)] = src[RIDX(i j dim)];
}
/*
* rotate - Your current working version of rotate
* IMPORTANT: This is the version you will be graded on
*/
char rotate_descr[] = “rotate: Current working version“;
void rotate(int dim pixel *src pixel *dst)
{
int i j;
dst += (dim-1)*dim;
for (i = 0; i < dim; i+=32){
for (j = 0; j < dim; j++){
*dst=*src;
src+=dim;
dst+=1;
*dst=*src;
src+=dim;
dst+=1;
*dst=*src;
src+=dim;
dst+=1;
*dst=*src;
src+=dim;
dst+=1;
*dst=*src;
src+=dim;
dst+=1;
*dst=*src;
src+=dim;
dst+=1;
*dst=*src;
src+=dim;
dst+=1;
*dst=*src;
src+=dim;
dst+=1;
*dst=*src;
src+=dim;
dst+=1;
*dst=*src;
src+=dim;
dst+=1;
*dst=*src;
src+=dim;
dst+=1;
*dst=*src;
src+=dim;
dst+=1;
*dst=*src;
src+=dim;
dst+=1;
*dst=*src;
src+=dim;
dst+=1;
*dst=*src;
src+=dim;
dst+=1;
*dst=*src;
src+=dim;
dst+=1;
*dst=*src;
src+=dim;
dst+=1;
*dst=*src;
相关资源
- Qt QLabel滚动字幕.zip
- CSAPP 六个重要实验 lab4 实验指导书
- SAX符号化序列范例源码
- labview 读取并显示图片
- labview十六进制转换成浮点数
- 简易滤除信号噪声
- 基于labview的模拟温度采集系统
- labview 的PID实验程序
- 基于LabVIEW实时数据采集系统的设计
- csapp proxylab
- csapp lab archlab 解答
- 傅里叶特征描述子图像匹配
- 光伏三相逆变的有功无功调节锁相环
- CVI对普通USB摄像头的控制代码
- labview读取键盘
- labview条形码识别
- 光流图像配准
- 基于labview的步进电机控制
- SL257lab实验答案
- QRS起点终点检测
- 基于LabVIEW的交通灯设计259684
- labview设置共享变量以使其可以在两台
- SVM with mosek for banana
- 应用牛顿法求方程cos(x)cosh(x)-
- USB4711采集卡采集程序
- labview 自动售货机
- 用信号发生器控件和示波器控件设计
- LabVIEW创建波形,回放波形,TDMS存储
- labview的modbus通讯方式
- 一个mantlab写的该程序完成16个脉冲信
评论
共有 条评论