diff --git a/cpp/bench/prims/neighbors/knn.cuh b/cpp/bench/prims/neighbors/knn.cuh index 176b10cee8..8dabe5dc46 100644 --- a/cpp/bench/prims/neighbors/knn.cuh +++ b/cpp/bench/prims/neighbors/knn.cuh @@ -91,13 +91,9 @@ inline auto operator<<(std::ostream& os, const Scope& s) -> std::ostream& struct device_resource { public: explicit device_resource(bool managed) - : managed_(managed ? std::make_shared() : nullptr) + : managed_(managed ? std::make_shared() : nullptr), + res_(managed ? managed.get() : raft::resource::get_current_device_resource_ref()) { - if (managed) { - res_ = managed.get(); - } else { - res_ = raft::resource::get_current_device_resource_ref(); - } } ~device_resource() {}