       const std::vector<int>& nidx_set, RegTree* p_tree) {
     auto columns = info_->num_col_;
     std::vector<DeviceSplitCandidate> best_splits(nidx_set.size());
-    DeviceSplitCandidate* candidate_splits;
-    dh::safe_cuda(cudaMallocHost(&candidate_splits, nidx_set.size() *
-      columns * sizeof(DeviceSplitCandidate)));
+    std::vector<DeviceSplitCandidate> candidate_splits(nidx_set.size() * columns);
     // Use first device
     auto& shard = shards_.front();
     dh::safe_cuda(cudaSetDevice(shard->device_idx));

  struct ExpandEntry;

  GPUHistMaker() : initialised_(false), p_last_fmat_(nullptr) {}
  void Init(
      const std::vector<std::pair<std::string, std::string>>& args) override {
    param_.InitAllowUnknown(args);

      }
      best_splits[i] = nidx_best;
    }
    return std::move(best_splits);
  }

