From 69f2911e04ffb1b19eef1fafb8c040af271f656e Mon Sep 17 00:00:00 2001 From: Tor Aamodt Date: Thu, 15 Jul 2010 18:09:46 -0800 Subject: creating branch for adding support for CUDA 3.x and Fermi [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 6829] --- benchmarks/CUDA/RAY/makebmp.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 benchmarks/CUDA/RAY/makebmp.cpp (limited to 'benchmarks/CUDA/RAY/makebmp.cpp') diff --git a/benchmarks/CUDA/RAY/makebmp.cpp b/benchmarks/CUDA/RAY/makebmp.cpp new file mode 100644 index 0000000..1b006ec --- /dev/null +++ b/benchmarks/CUDA/RAY/makebmp.cpp @@ -0,0 +1,28 @@ +#include "EasyBMP.h" + +BMP out_bmp; + +void initialize_bmp(unsigned width, unsigned height, unsigned depth) +{ + SetEasyBMPwarningsOff(); + out_bmp.SetSize(width, height); + out_bmp.SetBitDepth(depth); +} + +void create_bmp(unsigned *data) +{ + unsigned height = out_bmp.TellHeight(); + unsigned width = out_bmp.TellWidth(); + for (unsigned y=0; y< height; y++){ + for (unsigned x=0; x< width; x++) { + //printf("%8x ", c_output[x+y*width]); + out_bmp(x,(height-y-1))->Red = 0x000000FF & data[x+y*width]; + out_bmp(x,(height-y-1))->Green = (0x0000FF00 & data[x+y*width]) >> 8; + out_bmp(x,(height-y-1))->Blue = (0x00FF0000 & data[x+y*width]) >> 16; + out_bmp(x,(height-y-1))->Alpha = (0xFF000000 & data[x+y*width]) >> 24; + } + } + out_bmp.WriteToFile("output.bmp"); +} + + -- cgit v1.3