This commit is contained in:
Evghenii
2014-01-05 12:23:48 +01:00
parent 62deb82bf8
commit a7c2a7d4f9
8 changed files with 76 additions and 27 deletions

View File

@@ -197,7 +197,12 @@ int main(int argc, char *argv[]) {
// And then read the triangles
uint nTris;
READ(nTris, 1);
#if 0
Triangle *triangles = new Triangle[nTris];
#else
Triangle *triangles;
ispc_malloc((void**)&triangles, nTris*sizeof(Triangle));
#endif
for (uint i = 0; i < nTris; ++i) {
// 9x floats for the 3 vertices
float v[9];
@@ -246,8 +251,8 @@ int main(int argc, char *argv[]) {
writeImage(id, image, width, height, "rt-ispc-1core.ppm");
#endif
memset(id, 0, width*height*sizeof(int));
memset(image, 0, width*height*sizeof(float));
ispc_memset(id, 0, width*height*sizeof(int));
ispc_memset(image, 0, width*height*sizeof(float));
//
// Run 3 iterations with ispc + 1 core, record the minimum time
@@ -266,8 +271,8 @@ int main(int argc, char *argv[]) {
writeImage(id, image, width, height, "rt-ispc-tasks.ppm");
memset(id, 0, width*height*sizeof(int));
memset(image, 0, width*height*sizeof(float));
ispc_memset(id, 0, width*height*sizeof(int));
ispc_memset(image, 0, width*height*sizeof(float));
//
// And 3 iterations with the serial implementation, reporting the