Commit 6403ae80 authored by tyhsu's avatar tyhsu

Add time measurement

parent 829c7b4a
...@@ -15,6 +15,9 @@ test: ldpc ...@@ -15,6 +15,9 @@ test: ldpc
cgdb: clean ldpc cgdb: clean ldpc
cuda-gdb --silent --args ldpc test_input.txt cuda-gdb --silent --args ldpc test_input.txt
prof: clean ldpc
nvprof ./ldpc test_input.txt
.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 channel_output.txt
...@@ -75,6 +75,9 @@ __global__ void BNProcess(int *const_llr, int *bnbuf, int *cnbuf, int *c2b_idx, ...@@ -75,6 +75,9 @@ __global__ void BNProcess(int *const_llr, int *bnbuf, int *cnbuf, int *c2b_idx,
int start = bnproc_idx[tid*2]; int start = bnproc_idx[tid*2];
int end = bnproc_idx[tid*2+1]; int end = bnproc_idx[tid*2+1];
// int arr[35] = {};
// get_data<<<1, end-start>>>(arr)
int val = 0; int val = 0;
for(int i = start; i < end; i++){ for(int i = start; i < end; i++){
if(i == tid) continue; if(i == tid) continue;
...@@ -192,14 +195,14 @@ int main(int argc, char **argv) ...@@ -192,14 +195,14 @@ int main(int argc, char **argv)
cudaDeviceSynchronize(); cudaDeviceSynchronize();
/*
cudaEvent_t start, end; cudaEvent_t start, end;
float time; float time;
cudaEventCreate(&start); cudaEventCreate(&start);
cudaEventCreate(&end); cudaEventCreate(&end);
cudaEventRecord(start, 0); cudaEventRecord(start, 0);
*/
llr2CN<<<blockNum, threadNum>>>(llr_d, cnbuf_d, l2c_idx_d); llr2CN<<<blockNum, threadNum>>>(llr_d, cnbuf_d, l2c_idx_d);
llr2BN<<<blockNum, threadNum>>>(llr_d, const_llr_d, l2b_idx_d); llr2BN<<<blockNum, threadNum>>>(llr_d, const_llr_d, l2b_idx_d);
...@@ -233,12 +236,12 @@ int main(int argc, char **argv) ...@@ -233,12 +236,12 @@ int main(int argc, char **argv)
BitDetermination<<<33, 256>>>(llrbuf_d, decode_output_d); BitDetermination<<<33, 256>>>(llrbuf_d, decode_output_d);
cudaDeviceSynchronize(); cudaDeviceSynchronize();
/*
cudaEventRecord(end, 0); cudaEventRecord(end, 0);
cudaEventSynchronize(end); cudaEventSynchronize(end);
cudaEventElapsedTime(&time, start, end); cudaEventElapsedTime(&time, start, end);
printf("time: %.6f ms\n", time); printf("time: %.6f ms\n", time);
*/
int err = 0; int err = 0;
for(int i = 0; i < 8448/8; i++){ for(int i = 0; i < 8448/8; i++){
......
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