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

[NV12toBGRandResize] output raw files with all of 0 value. #279

Open
jskimn opened this issue Jun 26, 2024 · 0 comments
Open

[NV12toBGRandResize] output raw files with all of 0 value. #279

jskimn opened this issue Jun 26, 2024 · 0 comments

Comments

@jskimn
Copy link

jskimn commented Jun 26, 2024

Sample name: 5_Domain_Specific/NV12toBGRandResize
Environment: Windows VS2019.

After nv12ToBGRplanarBatch kernel, d_outputBGR has all of 0 value.
And 'output/t1/converted_bgr_640x480_1.raw" has all of 0 value.
I checked that 'nv12ToBGRplanarBatch' kernel has some problem like following code.

for (int i = 0; i < TEST_LOOP; i++) {
    nv12ToBGRplanarBatch(d_resizedNV12, g_ctx.dst_pitch,  // intput
                         d_outputBGR,
                         g_ctx.dst_pitch,    // output
                         g_ctx.dst_width, g_ctx.dst_height,  // output
                         g_ctx.batch, 0);
  }
  cudaEventRecord(stop, 0);
  cudaEventSynchronize(stop);

  int dataSize = g_ctx.dst_pitch * g_ctx.dst_height * 3 * g_ctx.batch * sizeof(float);
  char* cpuData = new char[dataSize];
  checkCudaErrors(cudaMemcpy((void*)cpuData, (void*)d_outputBGR, dataSize, cudaMemcpyDeviceToHost));
  int temp = 0;
  delete[] cpuData;

When I break at "int temp = 0" line, I could see that 'cpuData' has all of 0 value.
What did I do wrong?

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

No branches or pull requests

1 participant