Files
rocm-systems/rocclr/runtime/device/cpu/cpuvirtual.hpp
T
foreman 9ba3948388 P4 to Git Change 1421208 by gandryey@gera-w8 on 2017/06/12 13:15:22
SWDEV-124171 - adding support for p2p OCL in rocm stack
	- Add cl_amd_copy_buffer_p2p extension for P2P transfers. The extension adds a new API entry - clEnqueueCopyBufferP2PAMD() which allows to transfer CL buffers between different CL contexts on different GPUs. If P2P isn't possible, then double copy performed
	- Also the app can query the P2P support capabilities for the device. A list of P2P accessible devices can be returned for the current device

	http://ocltc.amd.com/reviews/r/12913/

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_context.cpp#54 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_device.cpp#62 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_p2p_amd.cpp#1 add
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_p2p_amd.h#1 add
... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_ext.h#29 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/cpu/cpuvirtual.hpp#14 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#287 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.hpp#141 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.hpp#26 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocblit.cpp#19 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#54 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.hpp#22 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocmemory.cpp#24 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocsettings.cpp#19 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#39 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.hpp#12 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/command.cpp#79 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/command.hpp#84 edit
2017-06-12 13:31:09 -04:00

70 строки
2.8 KiB
C++

//
// Copyright (c) 2011 Advanced Micro Devices, Inc. All rights reserved.
//
#ifndef CPUVIRTUAL_HPP_
#define CPUVIRTUAL_HPP_
#include "top.hpp"
#include "device/device.hpp"
#include "thread/atomic.hpp"
#include "thread/thread.hpp"
#include "platform/ndrange.hpp"
//! \namespace cpu CPU Device Implementation
namespace cpu {
class WorkerThread;
class Device;
class VirtualCPU : public device::VirtualDevice {
private:
WorkerThread** cores_; //!< Pointer to array of Worker threads
static amd::Atomic<size_t> numWorkerThreads_; //!< Current Worker Threads number
bool acceptingCommands_;
public:
VirtualCPU(cpu::Device& device);
~VirtualCPU();
bool terminate();
WorkerThread* getWorkerThread(size_t id) { return cores_[id]; }
bool acceptingCommands() const { return acceptingCommands_; }
virtual void submitReadMemory(amd::ReadMemoryCommand& command);
virtual void submitWriteMemory(amd::WriteMemoryCommand& command);
virtual void submitCopyMemory(amd::CopyMemoryCommand& command);
virtual void submitCopyMemoryP2P(amd::CopyMemoryP2PCommand& command) {}
virtual void submitMapMemory(amd::MapMemoryCommand& command);
virtual void submitUnmapMemory(amd::UnmapMemoryCommand& command);
virtual void submitKernel(amd::NDRangeKernelCommand& command);
virtual void submitNativeFn(amd::NativeFnCommand& command);
virtual void submitMarker(amd::Marker& command);
virtual void submitFillMemory(amd::FillMemoryCommand& command);
virtual void submitMigrateMemObjects(amd::MigrateMemObjectsCommand& cmd) {}
virtual void submitAcquireExtObjects(amd::AcquireExtObjectsCommand& cmd);
virtual void submitReleaseExtObjects(amd::ReleaseExtObjectsCommand& cmd);
virtual void submitPerfCounter(amd::PerfCounterCommand& cmd);
virtual void submitThreadTraceMemObjects(amd::ThreadTraceMemObjectsCommand& cmd);
virtual void submitThreadTrace(amd::ThreadTraceCommand& cmd);
virtual void flush(amd::Command* list = NULL, bool wait = false);
virtual void submitSignal(amd::SignalCommand& cmd);
virtual void submitMakeBuffersResident(amd::MakeBuffersResidentCommand& cmd);
virtual void submitSvmFreeMemory(amd::SvmFreeMemoryCommand& cmd);
virtual void submitSvmCopyMemory(amd::SvmCopyMemoryCommand& cmd);
virtual void submitSvmFillMemory(amd::SvmFillMemoryCommand& cmd);
virtual void submitSvmMapMemory(amd::SvmMapMemoryCommand& cmd);
virtual void submitSvmUnmapMemory(amd::SvmUnmapMemoryCommand& cmd);
virtual void computeLocalSizes(amd::NDRangeKernelCommand& command, amd::NDRange& local);
static bool fillImage(amd::Image& image, address fillMem, const void* pattern,
const amd::Coord3D& origin, const amd::Coord3D& region, size_t rowPitch,
size_t slicePitch, size_t elementSize);
};
} // namespace cpu
#endif // CPUVIRTUAL_HPP_