check host malloc result
authorJonathan L Long <jonlong@cs.berkeley.edu>
Wed, 17 Dec 2014 04:18:53 +0000 (20:18 -0800)
committerJonathan L Long <jonlong@cs.berkeley.edu>
Wed, 17 Dec 2014 04:30:24 +0000 (20:30 -0800)
include/caffe/syncedmem.hpp

index db8d0e8..2564e07 100644 (file)
@@ -24,6 +24,7 @@ namespace caffe {
 
 inline void CaffeMallocHost(void** ptr, size_t size) {
   *ptr = malloc(size);
+  CHECK(*ptr) << "host allocation of size " << size << " failed";
 }
 
 inline void CaffeFreeHost(void* ptr) {