P4 to Git Change 1082378 by lmoriche@lmoriche_opencl_dev on 2014/09/29 17:08:11
ECR #304775 - Replace amd::Atomic with std::atomic Pre-checkin: http://ocltc.amd.com:8111/viewModification.html?modId=40639&personal=true&buildTypeId=&tab=vcsModificationBuilds&show_all_builds=true Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/os/os_posix.cpp#38 edit ... //depot/stg/opencl/drivers/opencl/runtime/os/os_win32.cpp#40 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/command.cpp#64 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/command.hpp#73 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.cpp#108 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.hpp#86 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/runtime.cpp#33 edit ... //depot/stg/opencl/drivers/opencl/runtime/thread/monitor.hpp#6 edit ... //depot/stg/opencl/drivers/opencl/runtime/thread/semaphore.cpp#6 edit ... //depot/stg/opencl/drivers/opencl/runtime/thread/semaphore.hpp#6 edit ... //depot/stg/opencl/drivers/opencl/runtime/utils/util.hpp#10 edit
This commit is contained in:
@@ -87,12 +87,12 @@ Memory::Memory(
|
||||
, isParent_(false)
|
||||
, vDev_(NULL)
|
||||
, forceSysMemAlloc_(false)
|
||||
, mapCount_(0)
|
||||
, svmHostAddress_(svmPtr)
|
||||
, svmPtrCommited_(false)
|
||||
, canBeCached_(true)
|
||||
, lockMemoryOps_("Memory Ops Lock", true)
|
||||
{
|
||||
std::atomic_init(&mapCount_, 0u);
|
||||
}
|
||||
|
||||
Memory::Memory(
|
||||
@@ -117,7 +117,6 @@ Memory::Memory(
|
||||
, isParent_(false)
|
||||
, vDev_(NULL)
|
||||
, forceSysMemAlloc_(false)
|
||||
, mapCount_(0)
|
||||
, svmHostAddress_(parent.getSvmPtr())
|
||||
, svmPtrCommited_(parent.isSvmPtrCommited())
|
||||
, canBeCached_(true)
|
||||
@@ -142,6 +141,8 @@ Memory::Memory(
|
||||
(CL_MEM_HOST_READ_ONLY | CL_MEM_HOST_WRITE_ONLY |
|
||||
CL_MEM_HOST_NO_ACCESS);
|
||||
}
|
||||
|
||||
std::atomic_init(&mapCount_, 0u);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -438,7 +439,7 @@ Memory::setDestructorCallback(DestructorCallBackFunction callback, void* data)
|
||||
}
|
||||
|
||||
entry->next_ = destructorCallbacks_;
|
||||
while (!destructorCallbacks_.compareAndSet(entry->next_, entry)) {
|
||||
while (!destructorCallbacks_.compare_exchange_weak(entry->next_, entry)) {
|
||||
// Someone else is also updating the head of the linked list! reload.
|
||||
entry->next_ = destructorCallbacks_;
|
||||
}
|
||||
|
||||
Referens i nytt ärende
Block a user