Misc: Fixed compilation issues on tests/bench
This commit is contained in:
@@ -171,7 +171,7 @@ void bench(isc::numeric_type dtype, std::string operation)
|
||||
}
|
||||
|
||||
unsigned int dtsize = isc::size_of(dtype);
|
||||
isc::driver::CommandQueue & queue = isc::driver::backend::default_queues()[0];
|
||||
isc::driver::CommandQueue & queue = isc::driver::backend::queues(isc::driver::backend::default_context())[0];
|
||||
std::map<std::string, std::string> metric{ {"axpy", "GB/s"}, {"dot", "GB/s"}, {"gemv", "GB/s"}, {"gemm", "GFLOPS"}};
|
||||
isc::array flush(1e6, dtype);
|
||||
std::cout << "#" << operation << " (" << metric[operation] << ")" << std::endl;
|
||||
@@ -403,21 +403,22 @@ int main(int argc, char* argv[])
|
||||
isc::driver::backend::queue_properties = CL_QUEUE_PROFILING_ENABLE;
|
||||
|
||||
int device_idx = 0;
|
||||
isc::driver::backend::container_type queues = isc::driver::backend::contexts();
|
||||
std::list<isc::driver::Context> const & contexts = isc::driver::backend::contexts();
|
||||
|
||||
std::string operation;
|
||||
if(queues.size() > 1)
|
||||
if(contexts.size() > 1)
|
||||
{
|
||||
if(args.size() != 3)
|
||||
{
|
||||
std::cerr << "usage : blas-bench DEVICE_IDX OPERATION" << std::endl;
|
||||
std::cout << "Devices available: " << std::endl;
|
||||
unsigned int current=0;
|
||||
for(isc::driver::backend::container_type::const_iterator it = queues.begin() ; it != queues.end() ; ++it)
|
||||
{
|
||||
isc::driver::Device device = it->first.device();
|
||||
std::cout << current++ << ": " << device.name() << " on " << device.platform().name() << " " << device.platform().version() << std::endl;
|
||||
}
|
||||
for(isc::driver::Context const & context: contexts)
|
||||
for(isc::driver::CommandQueue const & queue: isc::driver::backend::queues(context))
|
||||
{
|
||||
isc::driver::Device device = queue.device();
|
||||
std::cout << current++ << ": " << device.name() << " on " << device.platform().name() << " " << device.platform().version() << std::endl;
|
||||
}
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
device_idx = atoi(argv[1]);
|
||||
|
Reference in New Issue
Block a user