Skip to content

Commit

Permalink
Update solution 7
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdeakin committed Nov 24, 2014
1 parent 8741124 commit b218061
Show file tree
Hide file tree
Showing 15 changed files with 332 additions and 472 deletions.
25 changes: 6 additions & 19 deletions Solutions/Exercise07/C/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,41 @@
# History: Written by Tim mattson, August 2010
# Modified by Tom Deakin and Simon McIntosh-Smith, October 2012
# Modified by Tom Deakin, July 2013
# Modified by Tom Deakin, October 2014
#

ifndef CC
CC = gcc
endif

CCFLAGS=-O0 -std=c99 -g
CCFLAGS=-O3 -std=c99 -ffast-math

LIBS = -lm -lOpenCL -fopenmp

COMMON_DIR = ../../C_common

MMUL_OBJS = matmul.o matrix_lib.o wtime.o err_code.o
MMUL_OBJS = wtime.o
EXEC = mult

# Change this variable to specify the device type
# to the OpenCL device type of choice. You can also
# edit the variable in the source.
ifndef DEVICE
DEVICE = CL_DEVICE_TYPE_DEFAULT
endif

# Check our platform and make sure we define the APPLE variable
# and set up the right compiler flags and libraries
PLATFORM = $(shell uname -s)
ifeq ($(PLATFORM), Darwin)
LIBS = -lm -framework OpenCL
LIBS = -lm -framework OpenCL
endif

CCFLAGS += -D DEVICE=$(DEVICE)

all: $(EXEC)

mult: $(MMUL_OBJS)
$(CC) $(MMUL_OBJS) $(LIBS) -o $(EXEC)
mult: $(MMUL_OBJS) matmul.c matrix_lib.c
$(CC) $^ $(CCFLAGS) $(LIBS) -I $(COMMON_DIR) -o $(EXEC)

wtime.o: $(COMMON_DIR)/wtime.c
$(CC) -c $^ $(CCFLAGS) -o $@

err_code.o: $(COMMON_DIR)/err_code.c
$(CC) -c $^ $(CCFLAGS) -o $@

.c.o:
$(CC) -c $< $(CCFLAGS) -o $@

matmul.o: matmul.h matrix_lib.h

matrix_lib.o: matmul.h

clean:
rm -f $(MMUL_OBJS) $(EXEC)
Loading

0 comments on commit b218061

Please sign in to comment.