Skip to content

Commit 0757546

Browse files
committed
Add null check again for queue
1 parent 14dc5ac commit 0757546

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

sycl/source/handler.cpp

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1908,27 +1908,28 @@ void handler::verifyDeviceHasProgressGuarantee(
19081908
}
19091909

19101910
bool handler::supportsUSMMemcpy2D() {
1911-
assert(impl->MSubmissionPrimaryQueue &&
1912-
"handler should not have a null primary queue.");
1913-
return checkContextSupports(
1914-
impl->MSubmissionPrimaryQueue->getContextImplPtr(),
1915-
UR_CONTEXT_INFO_USM_MEMCPY2D_SUPPORT);
1911+
auto &PrimQueue = impl->MSubmissionPrimaryQueue;
1912+
if (PrimQueue)
1913+
return checkContextSupports(PrimQueue->getContextImplPtr(),
1914+
UR_CONTEXT_INFO_USM_MEMCPY2D_SUPPORT);
1915+
else
1916+
// Return true when handler_impl is constructed with a graph.
1917+
return true;
19161918
}
19171919

19181920
bool handler::supportsUSMFill2D() {
1919-
assert(impl->MSubmissionPrimaryQueue &&
1920-
"handler should not have a null primary queue.");
1921-
return checkContextSupports(
1922-
impl->MSubmissionPrimaryQueue->getContextImplPtr(),
1923-
UR_CONTEXT_INFO_USM_FILL2D_SUPPORT);
1921+
auto &PrimQueue = impl->MSubmissionPrimaryQueue;
1922+
if (PrimQueue)
1923+
return checkContextSupports(PrimQueue->getContextImplPtr(),
1924+
UR_CONTEXT_INFO_USM_FILL2D_SUPPORT);
1925+
else
1926+
// Return true when handler_impl is constructed with a graph.
1927+
return true;
19241928
}
19251929

19261930
bool handler::supportsUSMMemset2D() {
1927-
assert(impl->MSubmissionPrimaryQueue &&
1928-
"handler should not have a null primary queue.");
1929-
return checkContextSupports(
1930-
impl->MSubmissionPrimaryQueue->getContextImplPtr(),
1931-
UR_CONTEXT_INFO_USM_FILL2D_SUPPORT);
1931+
// memset use the same UR check as fill2D.
1932+
return supportsUSMFill2D();
19321933
}
19331934

19341935
id<2> handler::computeFallbackKernelBounds(size_t Width, size_t Height) {

0 commit comments

Comments
 (0)