Driver: now loading the backend dynamically on Linux

This commit is contained in:
Philippe Tillet
2015-08-25 12:41:21 -04:00
parent 868df9dad2
commit 67a35a62bd
44 changed files with 11808 additions and 13703 deletions

View File

@@ -11,14 +11,14 @@ Event::Event(backend_type backend) : backend_(backend), h_(backend_, true)
{
switch(backend_)
{
#ifdef ISAAC_WITH_CUDA
case CUDA:
cuda::check(cuEventCreate(&h_.cu().first, CU_EVENT_DEFAULT));
cuda::check(cuEventCreate(&h_.cu().second, CU_EVENT_DEFAULT));
cuda::check(dispatch::dispatch::cuEventCreate(&h_.cu().first, CU_EVENT_DEFAULT));
cuda::check(dispatch::dispatch::cuEventCreate(&h_.cu().second, CU_EVENT_DEFAULT));
break;
#endif
case OPENCL: break;
default: throw;
case OPENCL:
break;
default:
throw;
}
}
@@ -31,12 +31,10 @@ long Event::elapsed_time() const
{
switch(backend_)
{
#ifdef ISAAC_WITH_CUDA
case CUDA:
float time;
cuda::check(cuEventElapsedTime(&time, h_.cu().first, h_.cu().second));
cuda::check(dispatch::cuEventElapsedTime(&time, h_.cu().first, h_.cu().second));
return 1e6*time;
#endif
case OPENCL:
return static_cast<long>(ocl::info<CL_PROFILING_COMMAND_END>(h_.cl()) - ocl::info<CL_PROFILING_COMMAND_START>(h_.cl()));
default: