ocelot/ocelot/cuda/implementation/CudaDriverFrontend.cpp
void cuda::CudaDriverFrontend::_enumerateDevices() {
	if(_devicesLoaded) return;
	report("Creating devices.");
	if(config::get().executive.enableNVIDIA) {
		executive::DeviceVector d = 
			executive::Device::createDevices(ir::Instruction::SASS, _flags,
				_computeCapability);
		report(" - Added " << d.size() << " nvidia gpu devices." );
		_devices.insert(_devices.end(), d.begin(), d.end());
	}
	if(config::get().executive.enableEmulated) {
		executive::DeviceVector d = 
			executive::Device::createDevices(ir::Instruction::Emulated, _flags,
				_computeCapability);
		report(" - Added " << d.size() << " emulator devices." );
		_devices.insert(_devices.end(), d.begin(), d.end());
	}
	if(config::get().executive.enableLLVM) {
		executive::DeviceVector d = 
			executive::Device::createDevices(ir::Instruction::LLVM, _flags,
				_computeCapability);
		report(" - Added " << d.size() << " llvm-cpu devices." );
		_devices.insert(_devices.end(), d.begin(), d.end());
	}
	if(config::get().executive.enableAMD) {
		executive::DeviceVector d =
			executive::Device::createDevices(ir::Instruction::CAL, _flags,
				_computeCapability);
		report(" - Added " << d.size() << " amd gpu devices." );
		_devices.insert(_devices.end(), d.begin(), d.end());
	}
	_devicesLoaded = true;
	
	if(_devices.empty())
	{
		std::cerr << "==Ocelot== WARNING - No CUDA devices found or all " 
			<< "devices disabled!\n";
		std::cerr << "==Ocelot==  Consider enabling the emulator in " 
			<< "configure.ocelot.\n";
	}
}
//! \brief create devices if they do not exist
\brief create devices if they do not exist
\ brief create devices if they do not exist
void cuda::CudaDriverFrontend::_enumerateDevices() {
	if(_devicesLoaded) return;
	report("Creating devices.");
	if(config::get().executive.enableNVIDIA) {
		executive::DeviceVector d = 
			executive::Device::createDevices(ir::Instruction::SASS, _flags,
				_computeCapability);
		report(" - Added " << d.size() << " nvidia gpu devices." );
		_devices.insert(_devices.end(), d.begin(), d.end());
	}
	if(config::get().executive.enableEmulated) {
		executive::DeviceVector d = 
			executive::Device::createDevices(ir::Instruction::Emulated, _flags,
				_computeCapability);
		report(" - Added " << d.size() << " emulator devices." );
		_devices.insert(_devices.end(), d.begin(), d.end());
	}
	if(config::get().executive.enableLLVM) {
		executive::DeviceVector d = 
			executive::Device::createDevices(ir::Instruction::LLVM, _flags,
				_computeCapability);
		report(" - Added " << d.size() << " llvm-cpu devices." );
		_devices.insert(_devices.end(), d.begin(), d.end());
	}
	if(config::get().executive.enableAMD) {
		executive::DeviceVector d =
			executive::Device::createDevices(ir::Instruction::CAL, _flags,
				_computeCapability);
		report(" - Added " << d.size() << " amd gpu devices." );
		_devices.insert(_devices.end(), d.begin(), d.end());
	}
	_devicesLoaded = true;
	if(_devices.empty())
	{
		std::cerr << "==Ocelot== WARNING - No CUDA devices found or all " 
			<< "devices disabled!\n";
		std::cerr << "==Ocelot==  Consider enabling the emulator in " 
			<< "configure.ocelot.\n";
	}
}
void cuda :: CudaDriverFrontend :: _enumerateDevices ( ) { if ( _devicesLoaded ) return ; report ( " " ) ; if ( config :: get ( ) . executive . enableNVIDIA ) { executive :: DeviceVector d = executive :: Device :: createDevices ( ir :: Instruction :: SASS , _flags , _computeCapability ) ; report ( " " << d . size ( ) << " " ) ; _devices . insert ( _devices . end ( ) , d . begin ( ) , d . end ( ) ) ; } if ( config :: get ( ) . executive . enableEmulated ) { executive :: DeviceVector d = executive :: Device :: createDevices ( ir :: Instruction :: Emulated , _flags , _computeCapability ) ; report ( " " << d . size ( ) << " " ) ; _devices . insert ( _devices . end ( ) , d . begin ( ) , d . end ( ) ) ; } if ( config :: get ( ) . executive . enableLLVM ) { executive :: DeviceVector d = executive :: Device :: createDevices ( ir :: Instruction :: LLVM , _flags , _computeCapability ) ; report ( " " << d . size ( ) << " " ) ; _devices . insert ( _devices . end ( ) , d . begin ( ) , d . end ( ) ) ; } if ( config :: get ( ) . executive . enableAMD ) { executive :: DeviceVector d = executive :: Device :: createDevices ( ir :: Instruction :: CAL , _flags , _computeCapability ) ; report ( " " << d . size ( ) << " " ) ; _devices . insert ( _devices . end ( ) , d . begin ( ) , d . end ( ) ) ; } _devicesLoaded = true ; if ( _devices . empty ( ) ) { std :: cerr << " " << " \n " ; std :: cerr << " " << " \n " ; } }
\brief create devices if they do not exist
\ brief create devices if they do not exist