没有合适的资源?快使用搜索试试~ 我知道了~
计算机体系结构的performance lab,分数为17.8和22.2,可直接使用
资源推荐
资源详情
资源评论
/********************************************************
* Kernels to be optimized for the CS:APP Performance Lab
********************************************************/
#include <stdio.h>
#include <stdlib.h>
#include "defs.h"
/*
* Please fill in the following team struct
*/
team_t team = {
"aaa", /* Team name */
"Habs", /* First member full name */
"abs@nowhdasdaedu", /* 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
******************************************************/
/*
* Kernels to be optimized for the CS:APP Performance Lab
********************************************************/
#include <stdio.h>
#include <stdlib.h>
#include "defs.h"
/*
* Please fill in the following team struct
*/
team_t team = {
"aaa", /* Team name */
"Habs", /* First member full name */
"abs@nowhdasdaedu", /* 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
******************************************************/
/*
* 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
* rotate: 16-way unroll, write spatial locality(from bottom)
* didn't use transpose + switch roll
*/
char rotate_descr[] = "rotate: Current working version";
void rotate(int dim, pixel *src, pixel *dst)
{
int i,j;
int offset = (dim<<4);
int dst_offset = dim*dim-dim;
dst += dst_offset;//from bottom
for(i=0; i<dim; i += 16){
for(j=0; j< dim ; j++ ){
*dst++ = *src;
src += dim;
*/
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
* rotate: 16-way unroll, write spatial locality(from bottom)
* didn't use transpose + switch roll
*/
char rotate_descr[] = "rotate: Current working version";
void rotate(int dim, pixel *src, pixel *dst)
{
int i,j;
int offset = (dim<<4);
int dst_offset = dim*dim-dim;
dst += dst_offset;//from bottom
for(i=0; i<dim; i += 16){
for(j=0; j< dim ; j++ ){
*dst++ = *src;
src += dim;
剩余10页未读,继续阅读
资源评论
sinat_29220019
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- CSP-JS2024第二轮官方测试数据
- 适用于typora编辑器的主题.zip
- chromedriver-win64-132.0.6824.0.zip
- chromedriver-win64-132.0.6823.0.zip
- chromedriver-win64-132.0.6821.2.zip
- petr按照j6中对transformer的处理进行优化,代码及结果
- PandaX是Go语言开源的企业级物联网平台低代码开发基座,支持设备管控,规则链,云组态,可视化大屏,报表设计器,表单设计器等功
- chromedriver-win64-132.0.6821.0.zip
- chromedriver-win64-132.0.6820.0.zip
- 短剧出海,1倍成本+,10倍利润↑
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功