@@ -84,28 +84,29 @@ void accel_sim_framework::simulation_loop() {
8484 // Launch all kernels within window that are on a stream that isn't already
8585 // running
8686 for (auto k : kernels_info) {
87+ bool is_graphics = m_gpgpu_sim->is_graphics (k->get_streamID ());
8788 bool stream_busy = false ;
8889 for (auto s : busy_streams) {
8990 if (s == k->get_cuda_stream_id ()) stream_busy = true ;
9091 }
9192 if (!stream_busy && m_gpgpu_sim->can_start_kernel () &&
9293 !k->was_launched ()) {
93- if (( launched_mesa ==
94- m_gpgpu_sim->get_config ().get_max_concurrent_kernel () * 3 /
95- 4 &&
96- k-> is_graphic_kernel ) ) {
94+ if (launched_mesa ==
95+ ( m_gpgpu_sim->get_config ().get_max_concurrent_kernel () * 3 /
96+ 4 ) &&
97+ is_graphics ) {
9798 continue ;
9899 }
99100 std::cout << " launching kernel name: " << k->get_name ()
100101 << " uid: " << k->get_uid ()
101102 << " cuda_stream_id: " << k->get_cuda_stream_id ()
102103 << std::endl;
103- if (!k->is_graphic_kernel ) {
104- m_gpgpu_sim->gipc = 0 ;
105- } else {
104+ if (is_graphics) {
106105 // graphics
107106 m_gpgpu_sim->cipc = 0 ;
108107 launched_mesa++;
108+ } else {
109+ m_gpgpu_sim->gipc = 0 ;
109110 }
110111 m_gpgpu_sim->launch (k);
111112 k->set_launched ();
@@ -193,9 +194,11 @@ void accel_sim_framework::parse_commandlist() {
193194 addre, Bcount, per_CTA);
194195 if (commandlist[commandlist_index].command_string .find (" MemcpyVulkan" ) ==
195196 std::string::npos) {
197+ // normal memcpy
196198 std::cout << " launching memcpy command : "
197199 << commandlist[commandlist_index].command_string << std::endl;
198- m_gpgpu_sim->perf_memcpy_to_gpu (addre, Bcount, false );
200+ m_gpgpu_sim->perf_memcpy_to_gpu (addre, Bcount, (uint64_t )-1 );
201+ // -1: does not belong to any stream
199202 } else {
200203 assert (per_CTA != (unsigned )-1 );
201204 kernel_vb_addr.push_back (addre);
@@ -210,6 +213,7 @@ void accel_sim_framework::parse_commandlist() {
210213 kernel_trace_t *kernel_trace_info = tracer.parse_kernel_info (
211214 commandlist[commandlist_index].command_string );
212215 if (kernel_trace_info->kernel_name .find (" VERTEX" ) != std::string::npos) {
216+ m_gpgpu_sim->set_graphics (graphics_stream_id);
213217 kernel_trace_info->cuda_stream_id = graphics_stream_id;
214218 last_grpahics_stream_id = graphics_stream_id;
215219 graphics_stream_id++;
@@ -220,7 +224,7 @@ void accel_sim_framework::parse_commandlist() {
220224 kernel_info = create_kernel_info (kernel_trace_info, m_gpgpu_context,
221225 &tconfig, &tracer);
222226
223- if (kernel_info->is_graphic_kernel ) {
227+ if (m_gpgpu_sim-> is_graphics ( kernel_info->get_streamID ()) ) {
224228 graphics_commands.push_back (commandlist[commandlist_index]);
225229 unsigned kernel_id = kernel_info->get_uid ();
226230
@@ -251,7 +255,7 @@ void accel_sim_framework::parse_commandlist() {
251255
252256void accel_sim_framework::cleanup (unsigned finished_kernel) {
253257 trace_kernel_info_t *k = NULL ;
254- unsigned long long finished_kernel_cuda_stream_id = -1 ;
258+ uint64_t finished_kernel_cuda_stream_id = -1 ;
255259 unsigned finishd_kernel_uid = 0 ;
256260 for (unsigned j = 0 ; j < kernels_info.size (); j++) {
257261 k = kernels_info.at (j);
@@ -277,7 +281,7 @@ void accel_sim_framework::cleanup(unsigned finished_kernel) {
277281 m_gpgpu_sim->get_config ().mps_sm_count ;
278282 }
279283 }
280- if (k->is_graphic_kernel ) {
284+ if (m_gpgpu_sim-> is_graphics ( k->get_streamID ()) ) {
281285 finished_graphics++;
282286 launched_mesa--;
283287 } else {
@@ -347,10 +351,6 @@ trace_kernel_info_t *accel_sim_framework::create_kernel_info(
347351 function_info->set_name (kernel_trace_info->kernel_name .c_str ());
348352 trace_kernel_info_t *kernel_info = new trace_kernel_info_t (
349353 gridDim, blockDim, function_info, parser, config, kernel_trace_info);
350- if (kernel_trace_info->kernel_name .find (" VERTEX" ) != std::string::npos ||
351- kernel_trace_info->kernel_name .find (" FRAG" ) != std::string::npos) {
352- kernel_info->is_graphic_kernel = true ;
353- }
354354
355355 return kernel_info;
356356}
0 commit comments