没有合适的资源?快使用搜索试试~ 我知道了~
计算机体系结构的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币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- dnSpy-net-win32-222.zip
- mongoose-free-6.9
- 德普微一级代理 DP100N06MGL PDFN3.3*3.3 TRMOS N-MOSFET 60V, 8mΩ, 45A
- 【java毕业设计】SpringBoot+Vue幼儿园管理系统 源码+sql脚本+论文 完整版
- 德普微一级代理 DP021N03FGLI DFN5*6 DPMOS N-MOSFET 30V 180A 1.8mΩ
- 巨潮资讯网5000只股票orgId-dict加密字典
- 基于java实现的快速排序代码
- 德普微一级代理 DP3145D SOT23-6 USB PD 协议单口控制器
- 【一文搞懂:什么是集成学习-原理+python代码】
- 国际象棋检测7-YOLO(v5至v9)、COCO、CreateML、Darknet、Paligemma、TFRecord数据集合集.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功