mirror of
https://github.com/xythrez/RustMP.git
synced 2025-09-02 21:02:36 +00:00
Updated README, added rayon and tests for comparision
This commit is contained in:
parent
db1fc0d3d3
commit
e36141a7cf
7 changed files with 308 additions and 0 deletions
55
omp/Makefile
Normal file
55
omp/Makefile
Normal file
|
@ -0,0 +1,55 @@
|
|||
#
|
||||
# File: Makefile
|
||||
# Author: Jack Yu (yyu57)
|
||||
# Simple generic makefile for my C projects
|
||||
# Run 'make build' to compile binary
|
||||
#
|
||||
|
||||
CC ?= gcc
|
||||
CFLAGS := -std=gnu17 -Werror -Wall -O3
|
||||
CFLAGS_SEQ := $(CFLAGS)
|
||||
CFLAGS_OMP := $(CFLAGS) -fopenmp -DPAR
|
||||
CFLAGS_OMP_SAFE := $(CFLAGS_OMP) -DCRIT
|
||||
|
||||
BIN := matmul
|
||||
BIN_SEQ := seqc_$(BIN)
|
||||
BIN_OMP := omp_$(BIN)
|
||||
BIN_OMP_SAFE := ompsafe_$(BIN)
|
||||
SRCDIR := src
|
||||
BLDDIR := build
|
||||
SRCS := $(shell find $(SRCDIR) -name '*.c')
|
||||
|
||||
# === Recipes ===
|
||||
.DEFAULT_GOAL := all
|
||||
|
||||
all: $(BIN_SEQ) $(BIN_OMP) $(BIN_OMP_SAFE)
|
||||
|
||||
$(BIN_SEQ): $(BLDDIR)/$(BIN_SEQ)
|
||||
@cp $(BLDDIR)/$(BIN_SEQ) $(BIN_SEQ)
|
||||
|
||||
$(BIN_OMP): $(BLDDIR)/$(BIN_OMP)
|
||||
@cp $(BLDDIR)/$(BIN_OMP) $(BIN_OMP)
|
||||
|
||||
$(BIN_OMP_SAFE): $(BLDDIR)/$(BIN_OMP_SAFE)
|
||||
@cp $(BLDDIR)/$(BIN_OMP_SAFE) $(BIN_OMP_SAFE)
|
||||
|
||||
$(BLDDIR)/$(BIN_SEQ): $(BLDDIR) $(SRCS)
|
||||
$(CC) $(CFLAGS_SEQ) $(SRCS) -o $@
|
||||
|
||||
$(BLDDIR)/$(BIN_OMP): $(BLDDIR) $(SRCS)
|
||||
$(CC) $(CFLAGS_OMP) $(SRCS) -o $@
|
||||
|
||||
$(BLDDIR)/$(BIN_OMP_SAFE): $(BLDDIR) $(SRCS)
|
||||
$(CC) $(CFLAGS_OMP_SAFE) $(SRCS) -o $@
|
||||
|
||||
build: all
|
||||
|
||||
$(BLDDIR):
|
||||
@mkdir -p $(BLDDIR)
|
||||
|
||||
clean:
|
||||
@rm -rf $(BLDDIR)
|
||||
@rm -f $(BIN_SEQ) $(BIN_OMP) $(BIN_OMP_SAFE)
|
||||
|
||||
.PHONY: build run clean all
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue