系统级程序设计——cache命中率

#include 
#include 
#include "defs.h"
#include "cache.h"


/* Here is an our naive implementation */
char rotate_descr[] = "Naive Row-wise Traversal of src";
void rotate(int dim, pixel *src, pixel *dst) {
	int i, j;

	for(i=0; i < dim; i++) {
		for(j=0; j < dim; j++) {
			COPY(&dst[PIXEL(dim-1-j,i,dim)], &src[PIXEL(i,j,dim)]);
		}
	}

	return;
}
char rotateTest_descr[] = "SMOOTH: Naive Row-wise Traversal of src";
void rotateTest(int dim, pixel *src, pixel *dst) {
    int i, j, ii = 0, jj = 0, blocksize = 16;
    for (ii = 0; ii

rotate.c

#include 
#include 
#include "defs.h"
#include "cache.h"




/* Here is an our naive implementation */
char smooth_descr[] = "SMOOTH: Naive Row-wise Traversal of src";
void smooth(int dim, pixel *src, pixel *dst) {
	int i, j;
	for(i=0; i

smooth.c

系统级程序设计——cache命中率_第1张图片

你可能感兴趣的:(系统级程序设计实验)