From 3844f7559e69f206a80ae9b970b19e7e609e949e Mon Sep 17 00:00:00 2001 From: WilliamMTK Date: Tue, 14 Jan 2025 12:33:11 -0500 Subject: [PATCH] fix_sst_callbacks: add weak definitions for sst callbacks (#81) * fix_sst_callbacks: add weak definitions for sst callbacks * Automated Format --------- Co-authored-by: purdue-jenkins --- src/gpgpu-sim/gpu-sim.h | 10 +++++++++- src/gpgpusim_entrypoint.cc | 1 + src/stream_manager.cc | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/gpgpu-sim/gpu-sim.h b/src/gpgpu-sim/gpu-sim.h index d0c2a1763..5b253ab10 100644 --- a/src/gpgpu-sim/gpu-sim.h +++ b/src/gpgpu-sim/gpu-sim.h @@ -78,6 +78,9 @@ extern tr1_hash_map address_random_interleaving; * @return false */ extern bool is_SST_buffer_full(unsigned core_id); +__attribute__((weak)) bool is_SST_buffer_full(unsigned core_id) { + return false; +} /** * @brief Send loads to SST memory backend @@ -89,7 +92,9 @@ extern bool is_SST_buffer_full(unsigned core_id); */ extern void send_read_request_SST(unsigned core_id, uint64_t address, size_t size, void *mem_req); - +__attribute__((weak)) void send_read_request_SST(unsigned core_id, + uint64_t address, size_t size, + void *mem_req) {} /** * @brief Send stores to SST memory backend * @@ -100,6 +105,9 @@ extern void send_read_request_SST(unsigned core_id, uint64_t address, */ extern void send_write_request_SST(unsigned core_id, uint64_t address, size_t size, void *mem_req); +__attribute__((weak)) void send_write_request_SST(unsigned core_id, + uint64_t address, size_t size, + void *mem_req) {} enum dram_ctrl_t { DRAM_FIFO = 0, DRAM_FRFCFS = 1 }; diff --git a/src/gpgpusim_entrypoint.cc b/src/gpgpusim_entrypoint.cc index 839fef619..e2b711ede 100644 --- a/src/gpgpusim_entrypoint.cc +++ b/src/gpgpusim_entrypoint.cc @@ -56,6 +56,7 @@ class stream_manager *g_stream_manager() { // SST callback extern void SST_callback_cudaThreadSynchronize_done(); +__attribute__((weak)) void SST_callback_cudaThreadSynchronize_done() {} void *gpgpu_sim_thread_sequential(void *ctx_ptr) { gpgpu_context *ctx = (gpgpu_context *)ctx_ptr; diff --git a/src/stream_manager.cc b/src/stream_manager.cc index b974791d0..58c2ec4b5 100644 --- a/src/stream_manager.cc +++ b/src/stream_manager.cc @@ -39,6 +39,10 @@ extern void SST_callback_memcpy_H2D_done(); extern void SST_callback_memcpy_D2H_done(); extern void SST_callback_memcpy_to_symbol_done(); extern void SST_callback_memcpy_from_symbol_done(); +__attribute__((weak)) void SST_callback_memcpy_H2D_done() {} +__attribute__((weak)) void SST_callback_memcpy_D2H_done() {} +__attribute__((weak)) void SST_callback_memcpy_to_symbol_done() {} +__attribute__((weak)) void SST_callback_memcpy_from_symbol_done() {} CUstream_st::CUstream_st() { m_pending = false;