From 2f4836a100dde7a7129625058bc458e83402cfbd Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 6 Nov 2011 12:00:41 -0500 Subject: [PATCH] bugfix from mike brown --- lib/gpu/lal_neighbor.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/gpu/lal_neighbor.cpp b/lib/gpu/lal_neighbor.cpp index 5f0b1b5c98..a1ec1d98c4 100644 --- a/lib/gpu/lal_neighbor.cpp +++ b/lib/gpu/lal_neighbor.cpp @@ -146,6 +146,10 @@ void Neighbor::alloc(bool &success) { ptr+=_max_nbors; } _c_bytes+=dev_host_nbor.row_bytes()+dev_host_numj.row_bytes(); + } else { + // Some OpenCL implementations return errors for NULL pointers as args + dev_host_nbor.view(dev_nbor); + dev_host_numj.view(dev_nbor); } if (_maxspecial>0) { dev_nspecial.clear(); @@ -460,7 +464,8 @@ void Neighbor::build_nbor_list(double **x, const int inum, const int host_inum, ptr+=mn; } _gpu_bytes+=dev_host_nbor.row_bytes(); - } + } else + dev_host_nbor.view(dev_nbor); if (_alloc_packed) { dev_packed.clear(); success=success && (dev_packed.alloc((mn+2)*_max_atoms,*dev,