Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main.cc is attempting to parse cpu_gpu_mem_copy as kernel_launch #107

Closed
FJShen opened this issue Mar 26, 2022 · 0 comments · Fixed by #110
Closed

main.cc is attempting to parse cpu_gpu_mem_copy as kernel_launch #107

FJShen opened this issue Mar 26, 2022 · 0 comments · Fixed by #110

Comments

@FJShen
Copy link
Contributor

FJShen commented Mar 26, 2022

unsigned i = 0;
while (i < commandlist.size() || !kernels_info.empty()) {
trace_kernel_info_t *kernel_info = NULL;
if (commandlist[i].m_type == command_type::cpu_gpu_mem_copy) {
size_t addre, Bcount;
tracer.parse_memcpy_info(commandlist[i].command_string, addre, Bcount);
std::cout << "launching memcpy command : " << commandlist[i].command_string << std::endl;
m_gpgpu_sim->perf_memcpy_to_gpu(addre, Bcount);
i++;
continue;
} else if (commandlist[i].m_type == command_type::kernel_launch) {
// Read trace header info for window_size number of kernels
while (kernels_info.size() < window_size && i < commandlist.size()) {
kernel_trace_t* kernel_trace_info = tracer.parse_kernel_info(commandlist[i].command_string);
kernel_info = create_kernel_info(kernel_trace_info, m_gpgpu_context, &tconfig, &tracer);
kernels_info.push_back(kernel_info);
std::cout << "Header info loaded for kernel command : " << commandlist[i].command_string << std::endl;
i++;
}

When concurrent kernel is enabled, this piece of implementation will attempt to parse as many lines in kernelslist.g as possible, assuming all of which are of command_type==kernel_launch. But when there are cpu_gpu_mem_copy commands after kernel_launch in kernelslist.g, this can cause the simulator to break at trace_parser.cc:282.
For example consider the kernelslist.g file of backprob-rodinia-2.0-ft:

MemcpyHtoD,0x00007fa371500000,16388
MemcpyHtoD,0x00007fa371504400,278596
kernel-1.traceg
MemcpyHtoD,0x00007fa37154c600,68
MemcpyHtoD,0x00007fa37154c800,278596
MemcpyHtoD,0x00007fa371504400,278596
kernel-2.traceg

The simulator will fail while parsing the 4th line.

FJShen pushed a commit to FJShen/accel-sim-framework that referenced this issue Mar 28, 2022
...after realizing my fork's dev branch is outdated. Will re-do PR for
issue accel-sim#107 from here instead.
@FJShen FJShen changed the title Attempting to parse cpu_gpu_mem_copy as kernel_launch main.cc is attempting to parse cpu_gpu_mem_copy as kernel_launch Apr 5, 2022
barnes88 added a commit that referenced this issue Apr 14, 2022
@FJShen FJShen linked a pull request Apr 14, 2022 that will close this issue
@FJShen FJShen closed this as completed Apr 14, 2022
JRPan pushed a commit that referenced this issue Feb 12, 2023
...after realizing my fork's dev branch is outdated. Will re-do PR for
issue #107 from here instead.
JRPan pushed a commit that referenced this issue Feb 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant