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

[RUNTIME][OPENCL] clFinish before releasing memory #2737

Merged
merged 1 commit into from
Mar 7, 2019

Conversation

kazum
Copy link
Contributor

@kazum kazum commented Mar 5, 2019

The OpenCL specification says that it is safe to call clReleaseMemObject even when the memory object is in use, but some OpenCL platforms violate the specification unfortunately.

This PR calls clFinish before clReleaseMemObject to make sure that the memory object is not in use. This change doesn't have impact on performance since memory objects are cached by workspace pool of TVM and they are not released at run time usually.

@tqchen @Laurawly @nishi-t please help review this PR.

@tqchen tqchen merged commit 66cad62 into apache:master Mar 7, 2019
@kazum kazum deleted the opencl-safe-mem-release branch March 7, 2019 06:37
wweic pushed a commit to neo-ai/tvm that referenced this pull request Mar 9, 2019
wweic pushed a commit to neo-ai/tvm that referenced this pull request Mar 12, 2019
wweic pushed a commit to neo-ai/tvm that referenced this pull request Mar 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants