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

hipFree returns error code when 0/null-pointer is passed. #20

Closed
briansp2020 opened this issue Jun 8, 2016 · 2 comments
Closed

hipFree returns error code when 0/null-pointer is passed. #20

briansp2020 opened this issue Jun 8, 2016 · 2 comments

Comments

@briansp2020
Copy link

I don't know how common the practice is. But Udacity homework code calls cudaFree(0) before doing anything else and hipified version returns error code and cause the program to exit with an error. If this practice is common among CUDA software, hipFree should return success code and make it behave more like cudaFree. In C, calling free with 0/null-pointer does not cause error either.

See line 27 of https://github.com/udacity/cs344/blob/master/Problem%20Sets/Problem%20Set%201/HW1.cpp

@bensander
Copy link
Contributor

Yes, calling hipFree with NULL pointer should initialize the runtime but not return an error. We will fix.

@mangupta
Copy link
Contributor

This was fixed in hip 0.90. Calling hipFree(0) now initializes the runtime and returns hipSuccess.

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

3 participants