+using kernels1 in deferred
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
EXAMPLE=deferred_shading
|
EXAMPLE=deferred_shading
|
||||||
CPP_SRC=common.cpp main.cpp dynamic_c.cpp dynamic_cilk.cpp
|
CPP_SRC=common.cpp main.cpp
|
||||||
ISPC_SRC=kernels.ispc
|
ISPC_SRC=kernels1.ispc
|
||||||
ISPC_IA_TARGETS=avx
|
ISPC_IA_TARGETS=avx
|
||||||
ISPC_FLAGS=--opt=fast-math
|
ISPC_FLAGS=--opt=fast-math
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ enum InputDataArraysEnum {
|
|||||||
#ifndef ISPC
|
#ifndef ISPC
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "kernels_ispc.h"
|
#include "kernels1_ispc.h"
|
||||||
|
|
||||||
#define ALIGNMENT_BYTES 64
|
#define ALIGNMENT_BYTES 64
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,6 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
#include "deferred.h"
|
#include "deferred.h"
|
||||||
#include "kernels_ispc.h"
|
|
||||||
#include "../timing.h"
|
#include "../timing.h"
|
||||||
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
@@ -89,10 +88,12 @@ int main(int argc, char** argv) {
|
|||||||
Framebuffer framebuffer(input->header.framebufferWidth,
|
Framebuffer framebuffer(input->header.framebufferWidth,
|
||||||
input->header.framebufferHeight);
|
input->header.framebufferHeight);
|
||||||
|
|
||||||
|
#if 0
|
||||||
InitDynamicC(input);
|
InitDynamicC(input);
|
||||||
#ifdef __cilk
|
#ifdef __cilk
|
||||||
InitDynamicCilk(input);
|
InitDynamicCilk(input);
|
||||||
#endif // __cilk
|
#endif // __cilk
|
||||||
|
#endif
|
||||||
|
|
||||||
int nframes = 5;
|
int nframes = 5;
|
||||||
double ispcCycles = 1e30;
|
double ispcCycles = 1e30;
|
||||||
@@ -100,7 +101,7 @@ int main(int argc, char** argv) {
|
|||||||
framebuffer.clear();
|
framebuffer.clear();
|
||||||
const double t0 = rtc();
|
const double t0 = rtc();
|
||||||
for (int j = 0; j < nframes; ++j)
|
for (int j = 0; j < nframes; ++j)
|
||||||
ispc::RenderStatic(input->header, input->arrays,
|
ispc::RenderStatic(&input->header, &input->arrays,
|
||||||
VISUALIZE_LIGHT_COUNT,
|
VISUALIZE_LIGHT_COUNT,
|
||||||
framebuffer.r, framebuffer.g, framebuffer.b);
|
framebuffer.r, framebuffer.g, framebuffer.b);
|
||||||
double mcycles = 1000*(rtc() - t0) / nframes;
|
double mcycles = 1000*(rtc() - t0) / nframes;
|
||||||
@@ -110,6 +111,8 @@ int main(int argc, char** argv) {
|
|||||||
"%d x %d image\n", ispcCycles,
|
"%d x %d image\n", ispcCycles,
|
||||||
input->header.framebufferWidth, input->header.framebufferHeight);
|
input->header.framebufferWidth, input->header.framebufferHeight);
|
||||||
WriteFrame("deferred-ispc-static.ppm", input, framebuffer);
|
WriteFrame("deferred-ispc-static.ppm", input, framebuffer);
|
||||||
|
return 0;
|
||||||
|
#if 0
|
||||||
|
|
||||||
#ifdef __cilk
|
#ifdef __cilk
|
||||||
double dynamicCilkCycles = 1e30;
|
double dynamicCilkCycles = 1e30;
|
||||||
@@ -145,6 +148,7 @@ int main(int argc, char** argv) {
|
|||||||
#else
|
#else
|
||||||
printf("\t\t\t\t(%.2fx speedup from ISPC + tasks)\n", serialCycles/ispcCycles);
|
printf("\t\t\t\t(%.2fx speedup from ISPC + tasks)\n", serialCycles/ispcCycles);
|
||||||
#endif // __cilk
|
#endif // __cilk
|
||||||
|
#endif
|
||||||
|
|
||||||
DeleteInputData(input);
|
DeleteInputData(input);
|
||||||
|
|
||||||
|
|||||||
@@ -55,8 +55,8 @@
|
|||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include "kernels1_ispc.h"
|
||||||
#include "deferred.h"
|
#include "deferred.h"
|
||||||
#include "kernels_ispc.h"
|
|
||||||
#include "../timing.h"
|
#include "../timing.h"
|
||||||
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user