We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
HostPtr
SYCLMemObjT
1 parent 557204a commit 1b2b9ddCopy full SHA for 1b2b9dd
sycl/source/detail/sycl_mem_obj_t.hpp
@@ -186,13 +186,15 @@ class __SYCL_EXPORT SYCLMemObjT : public SYCLMemObjI {
186
});
187
}
188
189
- if (canReuseHostPtr(HostPtr, RequiredAlign)) {
190
- MUserPtr = HostPtr;
191
- } else {
192
- setAlign(RequiredAlign);
193
- MShadowCopy = allocateHostMem();
194
- MUserPtr = MShadowCopy;
195
- std::memcpy(MUserPtr, HostPtr, MSizeInBytes);
+ if (HostPtr) {
+ if (canReuseHostPtr(HostPtr, RequiredAlign)) {
+ MUserPtr = HostPtr;
+ } else {
+ setAlign(RequiredAlign);
+ MShadowCopy = allocateHostMem();
+ MUserPtr = MShadowCopy;
196
+ std::memcpy(MUserPtr, HostPtr, MSizeInBytes);
197
+ }
198
199
200
0 commit comments