22 | | - codul paralelizat (segment.cu) se gaseste in folderul segmment |
| 22 | |
| 23 | * codul paralelizat (segment.cu) se gaseste in folderul segment de pe svn |
| 24 | * pentru compilare si rulare se poate folosi Makefile-ul aflat in folderul segment de pe svn, in care se vor inlocui caile spre headerele CUDA, biblioteca CUDPP, si alte headere si biblioteci necesare. |
| 25 | |
| 26 | {{{ |
| 27 | INCDIR = -I. -I/usr/local/cuda/sdk/C/common/inc -I/home/szekeres/Desktop/cudpp_1.1/cudpp/include |
| 28 | LIBS = -lcudpp |
| 29 | LIBDIR = -L/home/szekeres/Desktop/cudpp_1.1/lib |
| 30 | DBG = -g |
| 31 | CPP = g++ |
| 32 | CFLAGS = $(DBG) $(INCDIR) |
| 33 | LINK = -lm |
| 34 | |
| 35 | .cpp.o: |
| 36 | $(CPP) $(CFLAGS) -c $< -o $@ |
| 37 | |
| 38 | all: parallel sequential |
| 39 | |
| 40 | parallel: |
| 41 | nvcc segment.cu -o parallel ${INCDIR} ${LIBDIR} ${LIBS} |
| 42 | |
| 43 | sequential: segment.cpp segment-image.h segment-graph.h disjoint-set.h |
| 44 | $(CPP) $(CFLAGS) -o sequential segment.cpp $(LINK) |
| 45 | |
| 46 | clean: |
| 47 | /bin/rm -f parallel sequential *.o |
| 48 | |
| 49 | clean-all: clean |
| 50 | /bin/rm -f *~ |
| 51 | |
| 52 | run_parallel: |
| 53 | ./parallel 0.8 500 20 lanscape_vectors.ppm out.ppm |
| 54 | |
| 55 | run_sequential: |
| 56 | ./sequential 0.8 500 20 lanscape_vectors.ppm out.ppm |
| 57 | |
| 58 | }}} |