Driver: now loading the backend dynamically on Linux
This commit is contained in:
@@ -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:
|
||||
|
Reference in New Issue
Block a user