Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@asimay
Copy link

@asimay asimay commented Aug 11, 2023

some optimization for the main.cc code.

  1. add device and restrict decoration for style uniform and performance.
  2. an error in function call, in line: cudaMemcpyToSymbol(&cFoo, &bar, sizeof(int)); the first parameter should be pointer type.
    thanks.

asimay added 3 commits August 11, 2023 17:32
some optimization for the main.cc code.
1. add __device__ and __restrict__ decoration for style uniform and performance.
2. an error in function call, in line: cudaMemcpyToSymbol(&cFoo, &bar, sizeof(int)); the first parameter should be pointer type.
3. Hope you can send me your book. :)
delete the __device__
we already input N/2 in kernel launch function point, if we divide/2 here, the result is always wrong, seems half of the original result.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, maybe the line 76: cudaMemcpyToSymbol(&cFoo, &bar, sizeof(int)); modification is wrong.
please ignore this line.

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 this pull request may close these issues.

1 participant