Fix logic in GPU predictor cache lookup (#3217)

* Fix logic in GPU predictor cache lookup

* Add sklearn test for GPU prediction
This commit is contained in:
Rory Mitchell
2018-04-04 15:08:22 +12:00
committed by GitHub
parent a1ec7b1716
commit 443ff746e9
2 changed files with 29 additions and 1 deletions

View File

@@ -267,7 +267,7 @@ class GPUPredictor : public xgboost::Predictor {
std::shared_ptr<DeviceMatrix> device_matrix;
// Matrix is not in host cache, create a temporary matrix
if (this->cache_.find(dmat) != this->cache_.end()) {
if (this->cache_.find(dmat) == this->cache_.end()) {
device_matrix = std::shared_ptr<DeviceMatrix>(
new DeviceMatrix(dmat, param.gpu_id, param.silent));
} else {