MCPcopy Create free account
hub / github.com/LuxCoreRender/LuxCore / GetOpenCLDeviceList

Function GetOpenCLDeviceList

src/luxcore/pyluxcore.cpp:113–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113static boost::python::list GetOpenCLDeviceList() {
114 luxrays::Context ctx;
115 vector<luxrays::DeviceDescription *> deviceDescriptions = ctx.GetAvailableDeviceDescriptions();
116
117 // Select only OpenCL devices
118 luxrays::DeviceDescription::Filter(luxrays::DEVICE_TYPE_OPENCL_ALL, deviceDescriptions);
119
120 // Add all device information to the list
121 boost::python::list l;
122 for (size_t i = 0; i < deviceDescriptions.size(); ++i) {
123 luxrays::DeviceDescription *desc = deviceDescriptions[i];
124
125 l.append(boost::python::make_tuple(
126 desc->GetName(),
127 luxrays::DeviceDescription::GetDeviceType(desc->GetType()),
128 desc->GetComputeUnits(),
129 desc->GetNativeVectorWidthFloat(),
130 desc->GetMaxMemory(),
131 desc->GetMaxMemoryAllocSize()));
132 }
133
134 return l;
135}
136
137//------------------------------------------------------------------------------
138// Glue for Property class

Callers

nothing calls this directly

Calls 8

FilterClass · 0.50
sizeMethod · 0.45
appendMethod · 0.45
GetTypeMethod · 0.45
GetComputeUnitsMethod · 0.45
GetMaxMemoryMethod · 0.45
GetMaxMemoryAllocSizeMethod · 0.45

Tested by

no test coverage detected