コード例 #1
0
ファイル: device.cpp プロジェクト: Aligorith/blender
vector<DeviceInfo>& Device::available_devices()
{
	static vector<DeviceInfo> devices;
	static bool devices_init = false;

	if(!devices_init) {
#ifdef WITH_CUDA
		if(device_cuda_init())
			device_cuda_info(devices);
#endif

#ifdef WITH_OPENCL
		if(device_opencl_init())
			device_opencl_info(devices);
#endif

#ifdef WITH_MULTI
		device_multi_info(devices);
#endif

		device_cpu_info(devices);

#ifdef WITH_NETWORK
		device_network_info(devices);
#endif

		devices_init = true;
	}

	return devices;
}
コード例 #2
0
ファイル: device.cpp プロジェクト: JimStar/OctaneBlender
vector<DeviceInfo>& Device::available_devices()
{
	if(need_devices_update) {
		devices.clear();
#ifdef WITH_CUDA
		if(device_cuda_init())
			device_cuda_info(devices);
#endif

#ifdef WITH_OPENCL
		if(device_opencl_init())
			device_opencl_info(devices);
#endif

#ifdef WITH_MULTI
		device_multi_info(devices);
#endif

		device_cpu_info(devices);

#ifdef WITH_NETWORK
		device_network_info(devices);
#endif

		need_devices_update = false;
	}

	return devices;
}