[SYCLomatic] Removing data() from USM_NONE dpct::device_vector#667
Closed
danhoeflinger wants to merge 1 commit intooneapi-src:SYCLomaticfrom
Closed
Conversation
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
Contributor
Author
|
For an example of the usage which can be problematic when |
Contributor
Author
|
It looks like there is some work to be done in the migration tool here which will need to be done to handle |
ShengchenJ
pushed a commit
to ShengchenJ/SYCLomatic
that referenced
this pull request
Sep 27, 2024
…to test more cases (oneapi-src#667) Signed-off-by: Jiang, Zhiwei <zhiwei.jiang@intel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removing the public member function
data()ofdpct::device_vectorwhenDPCT_USM_LEVEL_NONEis defined.dpct::device_vectorhas two different implementations, one where USM is available and another when USM is not available which that usessycl::bufferinternally for its device memory. This change only effects the implementation when USM is not available andsycl::bufferis used for the memory allocation.This
data()member function does not make a lot of sense to provide when we are usingsycl::bufferas the memory backing fordpct::device_vector. Prior to this PR, it provided a pointer into the virtual memory space used to track and look up buffer allocations. Using this returned virtual pointer (whenDPCT_USM_LEVEL_NONEis defined) to do things likememcpy()or as input to an algorithm would result in a segfault. It's availability in the API only encourages incorrect usage.Getting a pointer to the actual device memory is not supported in any viable way by the SYCL specification when a
sycl::bufferis the backing memory for adpct::device_vector. The public member functionget_buffer()is provided in this case, and can be used for a similar purpose, but without encouraging incorrect usage.