From a58f0f6e55d026c66ab2fd1584471ecf7059281d Mon Sep 17 00:00:00 2001
From: foreman
Date: Thu, 5 Mar 2015 13:21:33 -0500
Subject: [PATCH] P4 to Git Change 1127860 by xcui@merged_opencl_jxcwin on
2015/03/05 12:15:14
EPR #414789 - fixed the failure of svm atomics failure with mulitple device support. The failure was caused by the svm allocation for the devices which don't support platform stomics svm.
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/platform/context.cpp#35 edit
[ROCm/clr commit: 13e7ed43f07b817bff70569d52e2b223385e0b25]
---
projects/clr/rocclr/runtime/platform/context.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/projects/clr/rocclr/runtime/platform/context.cpp b/projects/clr/rocclr/runtime/platform/context.cpp
index 65804772b7..f21eea2faf 100644
--- a/projects/clr/rocclr/runtime/platform/context.cpp
+++ b/projects/clr/rocclr/runtime/platform/context.cpp
@@ -307,6 +307,11 @@ Context::svmAlloc(size_t size, size_t alignment, cl_svm_mem_flags flags)
for (const auto& dev : svmAllocDevice_) {
if (dev->type() == CL_DEVICE_TYPE_GPU) {
+ //check if the device support svm platform atomics,
+ //skipped allocation for platform atomics if not supported by this device
+ if ((flags & CL_MEM_SVM_ATOMICS) && !(dev->info().svmCapabilities_ & CL_DEVICE_SVM_ATOMICS)) {
+ continue;
+ }
svmPtrAlloced = dev->svmAlloc(*this, size, alignment, flags, svmPtrAlloced);
if (svmPtrAlloced == NULL) {
return NULL;