From aa3cb10c91b1d0e5571172fdefa00aa575f26ebe Mon Sep 17 00:00:00 2001 From: Tim Rogers Date: Tue, 25 Jun 2013 13:30:10 -0800 Subject: Adding the ability to querry the WARPSZ flag from the ptx script. Also changed some initialization code when cores are created in both the funcational and perfromance simulator review:3001 lgtm:5 [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 16506] --- src/cuda-sim/cuda-sim.cc | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) (limited to 'src/cuda-sim/cuda-sim.cc') diff --git a/src/cuda-sim/cuda-sim.cc b/src/cuda-sim/cuda-sim.cc index a7294c1..ef50588 100644 --- a/src/cuda-sim/cuda-sim.cc +++ b/src/cuda-sim/cuda-sim.cc @@ -1702,7 +1702,11 @@ void gpgpu_cuda_ptx_sim_main_func( kernel_info_t &kernel, bool openCL ) //we excute the kernel one CTA (Block) at the time, as synchronization functions work block wise while(!kernel.no_more_ctas_to_run()){ - functionalCoreSim cta(&kernel, g_the_gpu, g_the_gpu->getShaderCoreConfig()->warp_size); + functionalCoreSim cta( + &kernel, + g_the_gpu, + g_the_gpu->getShaderCoreConfig()->warp_size + ); cta.execute(); } @@ -1744,27 +1748,22 @@ void gpgpu_cuda_ptx_sim_main_func( kernel_info_t &kernel, bool openCL ) void functionalCoreSim::initializeCTA() { int ctaLiveThreads=0; - m_warpsCount= ceil((double)m_kernel->threads_per_cta()/m_maxWarpSize); - initilizeSIMTStack(m_warpsCount,m_maxWarpSize); - m_warpAtBarrier = new bool [m_warpsCount]; - m_liveThreadCount = new unsigned [m_warpsCount]; - m_thread = new ptx_thread_info*[m_warpsCount*m_maxWarpSize]; - for(int i=0; i< m_warpsCount; i++){ + for(int i=0; i< m_warp_count; i++){ m_warpAtBarrier[i]=false; m_liveThreadCount[i]=0; } - for(int i=0; i< m_warpsCount*m_maxWarpSize;i++) + for(int i=0; i< m_warp_count*m_warp_size;i++) m_thread[i]=NULL; //get threads for a cta for(unsigned i=0; ithreads_per_cta();i++) { - ptx_sim_init_thread(*m_kernel,&m_thread[i],0,i,m_kernel->threads_per_cta()-i,m_kernel->threads_per_cta(),this,0,i/m_maxWarpSize,(gpgpu_t*)m_gpu, true); + ptx_sim_init_thread(*m_kernel,&m_thread[i],0,i,m_kernel->threads_per_cta()-i,m_kernel->threads_per_cta(),this,0,i/m_warp_size,(gpgpu_t*)m_gpu, true); assert(m_thread[i]!=NULL && !m_thread[i]->is_done()); ctaLiveThreads++; } - for(int k=0;klaunch(m_thread[warpId*m_maxWarpSize]->get_pc(),initialMask); + assert(m_thread[warpId*m_warp_size]!=NULL); + m_simt_stack[warpId]->launch(m_thread[warpId*m_warp_size]->get_pc(),initialMask); m_liveThreadCount[warpId]= liveThreadsCount; } @@ -1791,12 +1790,12 @@ void functionalCoreSim::execute() while(true){ bool someOneLive= false; bool allAtBarrier = true; - for(unsigned i=0;i0) someOneLive=true; if(!m_warpAtBarrier[i]&& m_liveThreadCount[i]>0) allAtBarrier = false; @@ -1989,7 +1988,7 @@ address_type get_converge_point( address_type pc ) void functionalCoreSim::warp_exit( unsigned warp_id ) { - for(int i=0;im_cta_info->register_deleted_thread(m_thread[i]); delete m_thread[i]; -- cgit v1.3