#include <intersectiondevice.h>
Public Member Functions | |
| OpenCLIntersectionDevice (const Context *context, OpenCLDeviceDescription *desc, const unsigned int index, const unsigned int forceWGSize) | |
| ~OpenCLIntersectionDevice () | |
| void | SetDataSet (const DataSet *newDataSet) |
| void | Start () |
| void | Interrupt () |
| void | Stop () |
| RayBuffer * | NewRayBuffer () |
| size_t | GetQueueSize () |
| void | PushRayBuffer (RayBuffer *rayBuffer) |
| RayBuffer * | PopRayBuffer () |
| const OpenCLDeviceDescription * | GetDeviceDesc () const |
| double | GetLoad () const |
| void | SetQBVHDisableImageStorage (const bool v) |
| cl::Context & | GetOpenCLContext () |
| cl::Device & | GetOpenCLDevice () |
| cl::CommandQueue & | GetOpenCLQueue () |
| unsigned int | GetForceWorkGroupSize () const |
| void | EnqueueTraceRayBuffer (cl::Buffer &rBuff, cl::Buffer &hBuff, const unsigned int rayCount) |
Static Public Attributes | |
| static size_t | RayBufferSize = OPENCL_RAYBUFFER_SIZE |
Protected Member Functions | |
| void | SetExternalRayBufferQueue (RayBufferQueue *queue) |
| void | UpdateDataSet () |
Private Member Functions | |
| void | TraceRayBuffer (RayBuffer *rayBuffer, cl::Event *event) |
| void | FreeDataSetBuffers () |
Static Private Member Functions | |
| static void | IntersectionThread (OpenCLIntersectionDevice *renderDevice) |
Private Attributes | |
| unsigned int | forceWorkGroupSize |
| OpenCLDeviceDescription * | deviceDesc |
| boost::thread * | intersectionThread |
| cl::CommandQueue * | oclQueue |
| cl::Kernel * | bvhKernel |
| size_t | bvhWorkGroupSize |
| cl::Buffer * | vertsBuff |
| cl::Buffer * | trisBuff |
| cl::Buffer * | bvhBuff |
| cl::Kernel * | qbvhKernel |
| size_t | qbvhWorkGroupSize |
| cl::Buffer * | qbvhBuff |
| cl::Buffer * | qbvhTrisBuff |
| cl::Kernel * | qbvhImageKernel |
| size_t | qbvhImageWorkGroupSize |
| cl::Image2D * | qbvhImageBuff |
| cl::Image2D * | qbvhTrisImageBuff |
| cl::Kernel * | mqbvhKernel |
| size_t | mqbvhWorkGroupSize |
| cl::Buffer * | mqbvhBuff |
| cl::Buffer * | mqbvhMemMapBuff |
| cl::Buffer * | mqbvhLeafBuff |
| cl::Buffer * | mqbvhLeafQuadTrisBuff |
| cl::Buffer * | mqbvhInvTransBuff |
| cl::Buffer * | mqbvhTrisOffsetBuff |
| cl::Buffer * | raysBuff |
| cl::Buffer * | hitsBuff |
| RayBufferQueueO2O | rayBufferQueue |
| RayBufferQueue * | externalRayBufferQueue |
| bool | reportedPermissionError |
| bool | qbvhUseImage |
| bool | qbvhDisableImageStorage |
Friends | |
| class | Context |
Definition at line 114 of file intersectiondevice.h.
| OpenCLIntersectionDevice::OpenCLIntersectionDevice | ( | const Context * | context, | |
| OpenCLDeviceDescription * | desc, | |||
| const unsigned int | index, | |||
| const unsigned int | forceWGSize | |||
| ) |
Definition at line 39 of file openclidevice.cpp.
References bvhBuff, bvhKernel, deviceDesc, luxrays::Device::deviceName, externalRayBufferQueue, forceWorkGroupSize, luxrays::DeviceDescription::GetName(), luxrays::OpenCLDeviceDescription::GetOCLContext(), luxrays::OpenCLDeviceDescription::GetOCLDevice(), intersectionThread, mqbvhBuff, mqbvhInvTransBuff, mqbvhKernel, mqbvhLeafBuff, mqbvhLeafQuadTrisBuff, mqbvhMemMapBuff, mqbvhTrisOffsetBuff, oclQueue, qbvhBuff, qbvhDisableImageStorage, qbvhImageBuff, qbvhImageKernel, qbvhKernel, qbvhTrisBuff, qbvhTrisImageBuff, qbvhUseImage, reportedPermissionError, trisBuff, and vertsBuff.
| OpenCLIntersectionDevice::~OpenCLIntersectionDevice | ( | ) |
Definition at line 85 of file openclidevice.cpp.
References bvhKernel, FreeDataSetBuffers(), mqbvhKernel, oclQueue, qbvhImageKernel, qbvhKernel, luxrays::Device::started, and Stop().
| void OpenCLIntersectionDevice::EnqueueTraceRayBuffer | ( | cl::Buffer & | rBuff, | |
| cl::Buffer & | hBuff, | |||
| const unsigned int | rayCount | |||
| ) |
Definition at line 757 of file openclidevice.cpp.
References luxrays::ACCEL_BVH, luxrays::ACCEL_MQBVH, luxrays::ACCEL_QBVH, bvhKernel, bvhWorkGroupSize, luxrays::IntersectionDevice::dataSet, luxrays::DataSet::GetAcceleratorType(), mqbvhKernel, mqbvhWorkGroupSize, oclQueue, qbvhImageKernel, qbvhImageWorkGroupSize, qbvhKernel, qbvhUseImage, qbvhWorkGroupSize, and luxrays::IntersectionDevice::statsTotalRayCount.
| void OpenCLIntersectionDevice::FreeDataSetBuffers | ( | ) | [private] |
Definition at line 122 of file openclidevice.cpp.
References bvhBuff, luxrays::IntersectionDevice::dataSet, deviceDesc, hitsBuff, mqbvhBuff, mqbvhInvTransBuff, mqbvhLeafBuff, mqbvhLeafQuadTrisBuff, mqbvhMemMapBuff, mqbvhTrisOffsetBuff, qbvhBuff, qbvhImageBuff, qbvhTrisBuff, qbvhTrisImageBuff, qbvhUseImage, raysBuff, trisBuff, luxrays::OpenCLDeviceDescription::usedMemory, and vertsBuff.
Referenced by SetDataSet(), and ~OpenCLIntersectionDevice().
| const OpenCLDeviceDescription* luxrays::OpenCLIntersectionDevice::GetDeviceDesc | ( | ) | const [inline] |
Definition at line 130 of file intersectiondevice.h.
References deviceDesc.
| unsigned int luxrays::OpenCLIntersectionDevice::GetForceWorkGroupSize | ( | ) | const [inline] |
Definition at line 148 of file intersectiondevice.h.
References forceWorkGroupSize.
| double luxrays::OpenCLIntersectionDevice::GetLoad | ( | ) | const [inline, virtual] |
Implements luxrays::IntersectionDevice.
Definition at line 132 of file intersectiondevice.h.
References luxrays::IntersectionDevice::statsDeviceIdleTime, and luxrays::IntersectionDevice::statsDeviceTotalTime.
| cl::Context& luxrays::OpenCLIntersectionDevice::GetOpenCLContext | ( | ) | [inline] |
Definition at line 145 of file intersectiondevice.h.
References deviceDesc, and luxrays::OpenCLDeviceDescription::GetOCLContext().
| cl::Device& luxrays::OpenCLIntersectionDevice::GetOpenCLDevice | ( | ) | [inline] |
Definition at line 146 of file intersectiondevice.h.
References deviceDesc, and luxrays::OpenCLDeviceDescription::GetOCLDevice().
| cl::CommandQueue& luxrays::OpenCLIntersectionDevice::GetOpenCLQueue | ( | ) | [inline] |
Definition at line 147 of file intersectiondevice.h.
References oclQueue.
| size_t luxrays::OpenCLIntersectionDevice::GetQueueSize | ( | ) | [inline, virtual] |
Implements luxrays::IntersectionDevice.
Definition at line 126 of file intersectiondevice.h.
References luxrays::RayBufferQueueO2O::GetSizeToDo(), and rayBufferQueue.
| void OpenCLIntersectionDevice::Interrupt | ( | ) | [virtual] |
Implements luxrays::Device.
Definition at line 685 of file openclidevice.cpp.
References intersectionThread, and luxrays::Device::started.
| void OpenCLIntersectionDevice::IntersectionThread | ( | OpenCLIntersectionDevice * | renderDevice | ) | [static, private] |
Definition at line 799 of file openclidevice.cpp.
References luxrays::Device::deviceContext, luxrays::Device::deviceName, externalRayBufferQueue, luxrays::RayBuffer::GetRayCount(), LR_LOG, luxrays::RayBufferQueue::Pop3xToDo(), luxrays::RayBufferQueue::PushDone(), rayBufferQueue, luxrays::IntersectionDevice::statsDeviceIdleTime, luxrays::IntersectionDevice::statsDeviceTotalTime, luxrays::IntersectionDevice::statsTotalRayCount, TraceRayBuffer(), and luxrays::WallClockTime().
Referenced by Start().
| RayBuffer * OpenCLIntersectionDevice::NewRayBuffer | ( | ) | [virtual] |
Implements luxrays::IntersectionDevice.
Definition at line 104 of file openclidevice.cpp.
References RayBufferSize.
| RayBuffer * OpenCLIntersectionDevice::PopRayBuffer | ( | ) | [virtual] |
Implements luxrays::IntersectionDevice.
Definition at line 115 of file openclidevice.cpp.
References externalRayBufferQueue, luxrays::RayBufferQueueO2O::PopDone(), rayBufferQueue, and luxrays::Device::started.
| void OpenCLIntersectionDevice::PushRayBuffer | ( | RayBuffer * | rayBuffer | ) | [virtual] |
Implements luxrays::IntersectionDevice.
Definition at line 108 of file openclidevice.cpp.
References externalRayBufferQueue, luxrays::RayBufferQueueO2O::PushToDo(), rayBufferQueue, and luxrays::Device::started.
| void OpenCLIntersectionDevice::SetDataSet | ( | const DataSet * | newDataSet | ) | [virtual] |
Reimplemented from luxrays::IntersectionDevice.
Definition at line 170 of file openclidevice.cpp.
References luxrays::DataSet::accel, luxrays::ACCEL_BVH, luxrays::ACCEL_MQBVH, luxrays::ACCEL_QBVH, luxrays::MQBVHAccel::accels, bvhBuff, bvhKernel, luxrays::BVHAccel::bvhTree, bvhWorkGroupSize, luxrays::QBVHNode::children, luxrays::IntersectionDevice::dataSet, luxrays::Device::deviceContext, deviceDesc, luxrays::Device::deviceName, luxrays::QBVHNode::FirstQuadIndex(), forceWorkGroupSize, FreeDataSetBuffers(), luxrays::DataSet::GetAcceleratorType(), luxrays::OpenCLDeviceDescription::GetImage2DMaxHeight(), luxrays::OpenCLDeviceDescription::GetImage2DMaxWidth(), luxrays::Transform::GetMatrix(), luxrays::OpenCLDeviceDescription::GetOCLContext(), luxrays::OpenCLDeviceDescription::GetOCLDevice(), luxrays::DataSet::GetTotalTriangleCount(), luxrays::DataSet::GetTotalVertexCount(), luxrays::TriangleMesh::GetTriangles(), luxrays::TriangleMesh::GetVertices(), luxrays::OpenCLDeviceDescription::HasImageSupport(), hitsBuff, luxrays::QBVHNode::IsEmpty(), luxrays::QBVHNode::IsLeaf(), luxrays::KernelSource_BVH, luxrays::KernelSource_MQBVH, luxrays::KernelSource_QBVH, luxrays::MQBVHAccel::leafs, luxrays::MQBVHAccel::leafsInvTransform, luxrays::MQBVHAccel::leafsOffset, LR_LOG, mqbvhBuff, mqbvhInvTransBuff, mqbvhKernel, mqbvhLeafBuff, mqbvhLeafQuadTrisBuff, mqbvhMemMapBuff, mqbvhTrisOffsetBuff, mqbvhWorkGroupSize, luxrays::QBVHNode::NbQuadPrimitives(), luxrays::MQBVHAccel::nLeafs, luxrays::MQBVHAccel::nNodes, luxrays::QBVHAccel::nNodes, luxrays::BVHAccel::nNodes, luxrays::MQBVHAccel::nodes, luxrays::QBVHAccel::nodes, luxrays::QBVHAccel::nQuads, oclQueue, luxrays::BVHAccel::preprocessedMesh, luxrays::QBVHAccel::prims, qbvhBuff, qbvhDisableImageStorage, qbvhImageBuff, qbvhImageKernel, qbvhImageWorkGroupSize, qbvhKernel, qbvhTrisBuff, qbvhTrisImageBuff, qbvhUseImage, qbvhWorkGroupSize, RayBufferSize, raysBuff, trisBuff, luxrays::OpenCLDeviceDescription::usedMemory, and vertsBuff.
| void OpenCLIntersectionDevice::SetExternalRayBufferQueue | ( | RayBufferQueue * | queue | ) | [protected, virtual] |
Implements luxrays::HardwareIntersectionDevice.
Definition at line 98 of file openclidevice.cpp.
References externalRayBufferQueue, and luxrays::Device::started.
| void luxrays::OpenCLIntersectionDevice::SetQBVHDisableImageStorage | ( | const bool | v | ) | [inline] |
Definition at line 137 of file intersectiondevice.h.
References qbvhDisableImageStorage.
| void OpenCLIntersectionDevice::Start | ( | ) | [virtual] |
Reimplemented from luxrays::IntersectionDevice.
Definition at line 671 of file openclidevice.cpp.
References luxrays::Device::deviceContext, luxrays::Device::deviceName, IntersectionThread(), intersectionThread, LR_LOG, reportedPermissionError, and luxrays::SetThreadRRPriority().
| void OpenCLIntersectionDevice::Stop | ( | ) | [virtual] |
Reimplemented from luxrays::Device.
Definition at line 690 of file openclidevice.cpp.
References luxrays::RayBufferQueueO2O::Clear(), externalRayBufferQueue, intersectionThread, and rayBufferQueue.
Referenced by ~OpenCLIntersectionDevice().
| void OpenCLIntersectionDevice::TraceRayBuffer | ( | RayBuffer * | rayBuffer, | |
| cl::Event * | event | |||
| ) | [private] |
Definition at line 702 of file openclidevice.cpp.
References luxrays::ACCEL_BVH, luxrays::ACCEL_MQBVH, luxrays::ACCEL_QBVH, bvhKernel, bvhWorkGroupSize, luxrays::IntersectionDevice::dataSet, luxrays::DataSet::GetAcceleratorType(), luxrays::RayBuffer::GetHitBuffer(), luxrays::RayBuffer::GetRayBuffer(), luxrays::RayBuffer::GetRayCount(), luxrays::RayBuffer::GetSize(), hitsBuff, mqbvhKernel, mqbvhWorkGroupSize, oclQueue, qbvhImageKernel, qbvhImageWorkGroupSize, qbvhKernel, qbvhUseImage, qbvhWorkGroupSize, and raysBuff.
Referenced by IntersectionThread().
| void OpenCLIntersectionDevice::UpdateDataSet | ( | ) | [protected] |
Definition at line 626 of file openclidevice.cpp.
References luxrays::DataSet::accel, luxrays::ACCEL_BVH, luxrays::ACCEL_MQBVH, luxrays::ACCEL_QBVH, luxrays::IntersectionDevice::dataSet, luxrays::Device::deviceContext, deviceDesc, luxrays::Device::deviceName, luxrays::DataSet::GetAcceleratorType(), luxrays::Transform::GetMatrix(), luxrays::OpenCLDeviceDescription::GetOCLContext(), luxrays::MQBVHAccel::leafsInvTransform, LR_LOG, mqbvhBuff, mqbvhInvTransBuff, mqbvhKernel, luxrays::MQBVHAccel::nLeafs, luxrays::MQBVHAccel::nNodes, luxrays::MQBVHAccel::nodes, oclQueue, and luxrays::OpenCLDeviceDescription::usedMemory.
friend class Context [friend] |
Reimplemented from luxrays::IntersectionDevice.
Definition at line 151 of file intersectiondevice.h.
cl::Buffer* luxrays::OpenCLIntersectionDevice::bvhBuff [private] |
Definition at line 177 of file intersectiondevice.h.
Referenced by FreeDataSetBuffers(), OpenCLIntersectionDevice(), and SetDataSet().
cl::Kernel* luxrays::OpenCLIntersectionDevice::bvhKernel [private] |
Definition at line 173 of file intersectiondevice.h.
Referenced by EnqueueTraceRayBuffer(), OpenCLIntersectionDevice(), SetDataSet(), TraceRayBuffer(), and ~OpenCLIntersectionDevice().
size_t luxrays::OpenCLIntersectionDevice::bvhWorkGroupSize [private] |
Definition at line 174 of file intersectiondevice.h.
Referenced by EnqueueTraceRayBuffer(), SetDataSet(), and TraceRayBuffer().
Definition at line 166 of file intersectiondevice.h.
Referenced by FreeDataSetBuffers(), GetDeviceDesc(), GetOpenCLContext(), GetOpenCLDevice(), OpenCLIntersectionDevice(), SetDataSet(), and UpdateDataSet().
Definition at line 208 of file intersectiondevice.h.
Referenced by IntersectionThread(), OpenCLIntersectionDevice(), PopRayBuffer(), PushRayBuffer(), SetExternalRayBufferQueue(), and Stop().
unsigned int luxrays::OpenCLIntersectionDevice::forceWorkGroupSize [private] |
Definition at line 165 of file intersectiondevice.h.
Referenced by GetForceWorkGroupSize(), OpenCLIntersectionDevice(), and SetDataSet().
cl::Buffer* luxrays::OpenCLIntersectionDevice::hitsBuff [private] |
Definition at line 205 of file intersectiondevice.h.
Referenced by FreeDataSetBuffers(), SetDataSet(), and TraceRayBuffer().
boost::thread* luxrays::OpenCLIntersectionDevice::intersectionThread [private] |
Definition at line 167 of file intersectiondevice.h.
Referenced by Interrupt(), OpenCLIntersectionDevice(), Start(), and Stop().
cl::Buffer* luxrays::OpenCLIntersectionDevice::mqbvhBuff [private] |
Definition at line 197 of file intersectiondevice.h.
Referenced by FreeDataSetBuffers(), OpenCLIntersectionDevice(), SetDataSet(), and UpdateDataSet().
cl::Buffer* luxrays::OpenCLIntersectionDevice::mqbvhInvTransBuff [private] |
Definition at line 201 of file intersectiondevice.h.
Referenced by FreeDataSetBuffers(), OpenCLIntersectionDevice(), SetDataSet(), and UpdateDataSet().
cl::Kernel* luxrays::OpenCLIntersectionDevice::mqbvhKernel [private] |
Definition at line 195 of file intersectiondevice.h.
Referenced by EnqueueTraceRayBuffer(), OpenCLIntersectionDevice(), SetDataSet(), TraceRayBuffer(), UpdateDataSet(), and ~OpenCLIntersectionDevice().
cl::Buffer* luxrays::OpenCLIntersectionDevice::mqbvhLeafBuff [private] |
Definition at line 199 of file intersectiondevice.h.
Referenced by FreeDataSetBuffers(), OpenCLIntersectionDevice(), and SetDataSet().
cl::Buffer* luxrays::OpenCLIntersectionDevice::mqbvhLeafQuadTrisBuff [private] |
Definition at line 200 of file intersectiondevice.h.
Referenced by FreeDataSetBuffers(), OpenCLIntersectionDevice(), and SetDataSet().
cl::Buffer* luxrays::OpenCLIntersectionDevice::mqbvhMemMapBuff [private] |
Definition at line 198 of file intersectiondevice.h.
Referenced by FreeDataSetBuffers(), OpenCLIntersectionDevice(), and SetDataSet().
cl::Buffer* luxrays::OpenCLIntersectionDevice::mqbvhTrisOffsetBuff [private] |
Definition at line 202 of file intersectiondevice.h.
Referenced by FreeDataSetBuffers(), OpenCLIntersectionDevice(), and SetDataSet().
size_t luxrays::OpenCLIntersectionDevice::mqbvhWorkGroupSize [private] |
Definition at line 196 of file intersectiondevice.h.
Referenced by EnqueueTraceRayBuffer(), SetDataSet(), and TraceRayBuffer().
cl::CommandQueue* luxrays::OpenCLIntersectionDevice::oclQueue [private] |
Definition at line 170 of file intersectiondevice.h.
Referenced by EnqueueTraceRayBuffer(), GetOpenCLQueue(), OpenCLIntersectionDevice(), SetDataSet(), TraceRayBuffer(), UpdateDataSet(), and ~OpenCLIntersectionDevice().
cl::Buffer* luxrays::OpenCLIntersectionDevice::qbvhBuff [private] |
Definition at line 184 of file intersectiondevice.h.
Referenced by FreeDataSetBuffers(), OpenCLIntersectionDevice(), and SetDataSet().
bool luxrays::OpenCLIntersectionDevice::qbvhDisableImageStorage [private] |
Definition at line 210 of file intersectiondevice.h.
Referenced by OpenCLIntersectionDevice(), SetDataSet(), and SetQBVHDisableImageStorage().
cl::Image2D* luxrays::OpenCLIntersectionDevice::qbvhImageBuff [private] |
Definition at line 191 of file intersectiondevice.h.
Referenced by FreeDataSetBuffers(), OpenCLIntersectionDevice(), and SetDataSet().
cl::Kernel* luxrays::OpenCLIntersectionDevice::qbvhImageKernel [private] |
Definition at line 188 of file intersectiondevice.h.
Referenced by EnqueueTraceRayBuffer(), OpenCLIntersectionDevice(), SetDataSet(), TraceRayBuffer(), and ~OpenCLIntersectionDevice().
size_t luxrays::OpenCLIntersectionDevice::qbvhImageWorkGroupSize [private] |
Definition at line 189 of file intersectiondevice.h.
Referenced by EnqueueTraceRayBuffer(), SetDataSet(), and TraceRayBuffer().
cl::Kernel* luxrays::OpenCLIntersectionDevice::qbvhKernel [private] |
Definition at line 182 of file intersectiondevice.h.
Referenced by EnqueueTraceRayBuffer(), OpenCLIntersectionDevice(), SetDataSet(), TraceRayBuffer(), and ~OpenCLIntersectionDevice().
cl::Buffer* luxrays::OpenCLIntersectionDevice::qbvhTrisBuff [private] |
Definition at line 185 of file intersectiondevice.h.
Referenced by FreeDataSetBuffers(), OpenCLIntersectionDevice(), and SetDataSet().
cl::Image2D* luxrays::OpenCLIntersectionDevice::qbvhTrisImageBuff [private] |
Definition at line 192 of file intersectiondevice.h.
Referenced by FreeDataSetBuffers(), OpenCLIntersectionDevice(), and SetDataSet().
bool luxrays::OpenCLIntersectionDevice::qbvhUseImage [private] |
Definition at line 210 of file intersectiondevice.h.
Referenced by EnqueueTraceRayBuffer(), FreeDataSetBuffers(), OpenCLIntersectionDevice(), SetDataSet(), and TraceRayBuffer().
size_t luxrays::OpenCLIntersectionDevice::qbvhWorkGroupSize [private] |
Definition at line 183 of file intersectiondevice.h.
Referenced by EnqueueTraceRayBuffer(), SetDataSet(), and TraceRayBuffer().
Definition at line 207 of file intersectiondevice.h.
Referenced by GetQueueSize(), IntersectionThread(), PopRayBuffer(), PushRayBuffer(), and Stop().
size_t OpenCLIntersectionDevice::RayBufferSize = OPENCL_RAYBUFFER_SIZE [static] |
Definition at line 153 of file intersectiondevice.h.
Referenced by NewRayBuffer(), and SetDataSet().
cl::Buffer* luxrays::OpenCLIntersectionDevice::raysBuff [private] |
Definition at line 204 of file intersectiondevice.h.
Referenced by FreeDataSetBuffers(), SetDataSet(), and TraceRayBuffer().
bool luxrays::OpenCLIntersectionDevice::reportedPermissionError [private] |
Definition at line 210 of file intersectiondevice.h.
Referenced by OpenCLIntersectionDevice(), and Start().
cl::Buffer* luxrays::OpenCLIntersectionDevice::trisBuff [private] |
Definition at line 176 of file intersectiondevice.h.
Referenced by FreeDataSetBuffers(), OpenCLIntersectionDevice(), and SetDataSet().
cl::Buffer* luxrays::OpenCLIntersectionDevice::vertsBuff [private] |
Definition at line 175 of file intersectiondevice.h.
Referenced by FreeDataSetBuffers(), OpenCLIntersectionDevice(), and SetDataSet().
1.6.3