File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -422,7 +422,9 @@ static bool isUSMPtr(
422422 sizeof (type),
423423 &type,
424424 nullptr );
425- return type != CL_MEM_TYPE_UNKNOWN_INTEL;
425+ // Workaround: some implementations return zero instead of UNKNOWN for
426+ // non-USM pointers, especially SVM pointers.
427+ return type != 0 && type != CL_MEM_TYPE_UNKNOWN_INTEL;
426428}
427429
428430static void parseSVMAllocProperties (
@@ -515,9 +517,7 @@ void* CL_API_CALL clSVMAllocWithPropertiesKHR_EMU(
515517 }
516518 else if ((caps & CL_SVM_TYPE_MACRO_FINE_GRAIN_BUFFER_KHR) == CL_SVM_TYPE_MACRO_FINE_GRAIN_BUFFER_KHR) {
517519 cl_svm_mem_flags svmFlags = CL_MEM_READ_WRITE | CL_MEM_SVM_FINE_GRAIN_BUFFER;
518-
519- const auto & typeCapsDevice = layerContext.TypeCapsDevice [device];
520- if (typeCapsDevice[svm_type_index] & CL_SVM_CAPABILITY_CONCURRENT_ATOMIC_ACCESS_KHR) {
520+ if (caps & CL_SVM_CAPABILITY_CONCURRENT_ATOMIC_ACCESS_KHR) {
521521 svmFlags |= CL_MEM_SVM_ATOMICS;
522522 }
523523 void * ret = g_pNextDispatch->clSVMAlloc (
You can’t perform that action at this time.
0 commit comments