Commit b128780e authored by tyhsu's avatar tyhsu

Add 'make prof' in Makefile to show detail of GPU activity

parent 6403ae80
...@@ -6,11 +6,12 @@ ...@@ -6,11 +6,12 @@
This version inherits the idea of current oai ldpc_decoder. It stores lots of LUTs and shrinks the cn, bnbuffer size comparing to the former implementation. Right now, it only supports the longest code block 8448. This version inherits the idea of current oai ldpc_decoder. It stores lots of LUTs and shrinks the cn, bnbuffer size comparing to the former implementation. Right now, it only supports the longest code block 8448.
### Usage ### Usage
+ `make ldpc` will compile the program `ldpc` + `make ldpc` will compile the program `ldpc`.
+ `make prof [num=<0~100>]` will show the detail of GPU activity.
+ `make test` will build ldpc executable and run `check.sh` to verify the correctness of the implementation. + `make test` will build ldpc executable and run `check.sh` to verify the correctness of the implementation.
### Verification ### Verification
+ The input (channel output) of the LDPC decoder is produced by the `ldpctest` program from OAI. + The input (channel output) of the LDPC decoder is produced by the `ldpctest` program from OAI.
+ The verification is done by comparing the data decoded with the input data (channel output), and also the data output(`estimated_output`) produced by oai `ldpctest` + The verification is done by comparing the data decoded with the input data (channel output), and also the data output(`estimated_output`) produced by oai `ldpctest`.
...@@ -5,7 +5,7 @@ exec = ldpc ...@@ -5,7 +5,7 @@ exec = ldpc
file = channel_output.txt file = channel_output.txt
OBJS = util.o OBJS = util.o
code = 8448 code = 8448
num = 1
.PHONY: clean debug .PHONY: clean debug
...@@ -18,12 +18,14 @@ $(exec): $(exec).cu $(OBJS) ...@@ -18,12 +18,14 @@ $(exec): $(exec).cu $(OBJS)
$(NVCC) $(CFLAGS) -o $@ $^ $(NVCC) $(CFLAGS) -o $@ $^
%.o: %.cu %.o: %.cu
cp ../test_input/8448/$(num).txt $(file)
$(NVCC) $(CFLAGS) -o $@ -c $< $(NVCC) $(CFLAGS) -o $@ -c $<
run: clean $(exec) run: clean $(exec)
./$(exec) -l $(code) -f $(file) ./$(exec) -l $(code) -f $(file)
prof: clean $(exec) prof: clean $(exec)
cp ../test_input/8448/$(num).txt $(file)
$(PROF) ./$(exec) -l $(code) -f $(file) $(PROF) ./$(exec) -l $(code) -f $(file)
test: clean $(exec) test: clean $(exec)
......
EXEC = gen_idx EXEC = gen_idx
TXT = gen_matrix.txt TXT = gen_matrix.txt
DEBUG = debug DEBUG = debug
FILE = channel_output.txt
num = 1
gen: clean gen_idx.c gen: clean gen_idx.c
$(CC) $(EXEC).c -o $(EXEC) -g $(CC) $(EXEC).c -o $(EXEC) -g
ldpc: clean ldpc.cu ldpc: clean ldpc.cu
cp ../test_input/8448/$(num).txt $(FILE)
nvcc ldpc.cu -o ldpc -g -G nvcc ldpc.cu -o ldpc -g -G
mkdir debug mkdir debug
...@@ -13,11 +16,12 @@ test: ldpc ...@@ -13,11 +16,12 @@ test: ldpc
./check.sh ./check.sh
cgdb: clean ldpc cgdb: clean ldpc
cuda-gdb --silent --args ldpc test_input.txt cuda-gdb --silent --args ldpc $(FILE)
prof: clean ldpc prof: clean ldpc
nvprof ./ldpc test_input.txt cp ../test_input/8448/$(num).txt $(FILE)
nvprof ./ldpc $(FILE)
.PHONY: clean .PHONY: clean
clean: clean:
$(RM) -rf $(DEBUG) $(EXEC) $(TXT) ldpc log.txt channel_output.txt $(RM) -rf $(DEBUG) $(EXEC) $(TXT) ldpc log.txt $(FILE)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment