bool TestDataflowGraph::_testSsa() { status << "Testing SSA Dataflow" << std::endl; for( StringVector::const_iterator file = _files.begin(); file != _files.end(); ++file ) { status << " For File: " << *file << std::endl; ir::Module module( *file ); for( ir::Module::KernelMap::iterator ki = module.kernels.begin(); ki != module.kernels.end(); ++ki ) { ir::PTXKernel& kernel = static_cast< ir::PTXKernel& >( *(ki->second) ); status << " For Kernel: " << kernel.name << std::endl; ir::PTXKernel::assignRegisters( *kernel.cfg() ); kernel.dfg()->compute(); kernel.dfg()->toSsa(); if( !_verifySsa( *kernel.dfg() ) ) { return false; } } } status << " Test Passed" << std::endl; return true; }
bool TestDataflowGraph::_testSsa() { status << "Testing SSA Dataflow" << std::endl; for( StringVector::const_iterator file = _files.begin(); file != _files.end(); ++file ) { status << " For File: " << *file << std::endl; ir::Module module; try { module.load( *file ); } catch(parser::PTXParser::Exception& e) { if(e.error == parser::PTXParser::State::NotVersion2_1) { status << " Skipping file with incompatible ptx version." << std::endl; continue; } status << "Load module failed with exception: " << e.what() << std::endl; return false; } for( ir::Module::KernelMap::const_iterator ki = module.kernels().begin(); ki != module.kernels().end(); ++ki ) { ir::PTXKernel& kernel = static_cast< ir::PTXKernel& >( *module.getKernel( ki->first ) ); status << " For Kernel: " << kernel.name << std::endl; analysis::DataflowGraph dfg; dfg.analyze( kernel ); dfg.toSsa(); if( !_verifySsa( dfg ) ) { return false; } } } status << " Test Passed" << std::endl; return true; }