P4 to Git Change 1533784 by vsytchen@vsytchen-ocl-win10 on 2018/03/28 11:22:25

SWDEV-133818 - PAL support for Linux Pro: Coarse Grain SVM for OpenCL 2.0

	This change enables Fine/Coarse Grain Buffer SVM suballocations for PAL devices

	ReviewBoardURL = http://ocltc.amd.com/reviews/r/14486/diff/

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.cpp#57 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.hpp#20 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/context.cpp#48 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/context.hpp#28 edit


[ROCm/clr commit: 3d15c543a0]
This commit is contained in:
foreman
2018-03-28 11:35:51 -04:00
parent 8edced52b8
commit 9bcdb4aa73
4 changed files with 184 additions and 80 deletions
@@ -296,6 +296,7 @@ void* Context::svmAlloc(size_t size, size_t alignment, cl_svm_mem_flags flags) {
void* svmPtrAlloced = NULL;
void* tempPtr = NULL;
amd::ScopedLock lock(&ctxLock_);
for (const auto& dev : svmAllocDevice_) {
if (dev->type() == CL_DEVICE_TYPE_GPU) {
// check if the device support svm platform atomics,
@@ -320,6 +321,7 @@ void Context::svmFree(void* ptr) const {
return;
}
amd::ScopedLock lock(&ctxLock_);
for (const auto& dev : svmAllocDevice_) {
if (dev->type() == CL_DEVICE_TYPE_GPU) {
dev->svmFree(ptr);
@@ -198,7 +198,7 @@ class Context : public RuntimeObject {
Device* customHostAllocDevice_; //!< Device responsible for host allocations
std::vector<Device*> svmAllocDevice_; //!< Devices can support SVM allocations
std::map<const Device*, DeviceQueueInfo> deviceQueues_; //!< Device queues mapping
Monitor ctxLock_; //!< Lock for the context access
mutable Monitor ctxLock_; //!< Lock for the context access
};
/*! @}