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

samples/0_Intro/module_api_global #444

Open
jinz2014 opened this issue Dec 15, 2023 · 1 comment
Open

samples/0_Intro/module_api_global #444

jinz2014 opened this issue Dec 15, 2023 · 1 comment

Comments

@jinz2014
Copy link

In samples/0_Intro/module_api_global,

for (int i = 0; i < ARRAY_SIZE; i++) {
        myDeviceGlobalArray_h[i] = i * 1000.0f;
        checkHipErrors(hipMemcpyHtoD(hipDeviceptr_t(myDeviceGlobalArray), &myDeviceGlobalArray_h, myDeviceGlobalArraySize));
    }

The memory copy may be lifted out of the loop.

@iassiour
Copy link
Contributor

Thank you for raising this @jinz2014 I will create an internal PR with the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants