views:

34

answers:

1

hi...i'm trying to count the GPU and CPU FLOPS and i've got the source from http://norma.mbg.duth.gr/index.php?id=about:benchmarks:cuda_flops

i renamed it to cudaflops.cu and compile it with this makefile

################################################################################
#
# Build script for project
#
################################################################################

# Add source files here 
EXECUTABLE  := benchmark
# Cuda source files (compiled with cudacc) 
CUFILES     := cudaflops.cu
# C/C++ source files (compiled with gcc / c++) 
CCFILES     := 


################################################################################
# Rules and targets

include ../../common/common.mk

#########################################

it works fine and give result 367 GFlops

but now, i don't know to test this source in CPU, i read hxxp://www.tomshardware.com/news/cuda-gpgpu-x86-opencl-directcompute,11341.html said that the source could run on cpu.

so how the modified makefile to do it??

A: 

Hey so the issue is you need portland group compilers in order to run your code on x86: hxxp://www.prnewswire.com/news-releases/pgi-to-develop-compiler-based-on-nvidia-cuda-c-architecture-for-x86-platforms-103457159.html

Additionally that article says that the compiler is being demonstrated November 13-15, 2010, so I'm not sure when it will be publicly available (probably a beta version floating around). (I.e. No you can't run CUDA natively on x86 YET).

right now the easiest thing to do is write a C/C++ function that does exactly what that benchmark does (it should be VERY easy to port). There are some CUDA examples in their SDK that compare CPU to GPU (look at matrix multiplication I think), so try that first (it should basically do the exact same thing as the benchmark code, except for a 'real world' case) if you're just looking to do GPU/CPU performance.

Even easier: ask NVIDIA forums about your graphics card - they love to tell everyone their GPU vs CPU performance (just say "I have x GPU and i get y GFLOPS-what does everyone else get GPU vs CPU?").

Marm0t