From 6069db1084bc8d1a03896f7e24a2d51e4634b484 Mon Sep 17 00:00:00 2001 From: Bandhav Veluri Date: Fri, 31 Jul 2020 13:21:08 -0700 Subject: [PATCH] Added barrier --- .../dram_latency/kernel_dram_latency.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/software/spmd/bsg_cuda_lite_runtime/dram_latency/kernel_dram_latency.cpp b/software/spmd/bsg_cuda_lite_runtime/dram_latency/kernel_dram_latency.cpp index 116fc7041..0a00ceb3d 100644 --- a/software/spmd/bsg_cuda_lite_runtime/dram_latency/kernel_dram_latency.cpp +++ b/software/spmd/bsg_cuda_lite_runtime/dram_latency/kernel_dram_latency.cpp @@ -5,6 +5,10 @@ #include #include +#include "bsg_tile_group_barrier.hpp" + +bsg_barrier barrier; + const size_t VCACHE_NUM_BLOCKS = VCACHE_SET * VCACHE_WAY; const size_t VCACHE_SIZE_WORDS = VCACHE_NUM_BLOCKS * VCACHE_BLOCK_SIZE_WORDS; @@ -76,7 +80,7 @@ int kernel_dram_latency(int dummy) { // Opens a new page assuming vcache size would be // a page boundary. - load_vcache_index(VCACHE_NUM_BLOCKS, 0); + if(__bsg_id == 0) load_vcache_index(VCACHE_NUM_BLOCKS, 0); bsg_cuda_print_stat_kernel_start(); if(__bsg_id == 0) { @@ -89,5 +93,7 @@ int kernel_dram_latency(int dummy) { } bsg_cuda_print_stat_kernel_end(); + barrier.sync(); + return 0; }