mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 13:40:46 +01:00
Diagnostics on memory alloc fail
This commit is contained in:
parent
dd891f5e3b
commit
7f45222924
@ -170,8 +170,10 @@ public:
|
|||||||
// Unified (managed) memory
|
// Unified (managed) memory
|
||||||
////////////////////////////////////
|
////////////////////////////////////
|
||||||
if ( ptr == (_Tp *) NULL ) {
|
if ( ptr == (_Tp *) NULL ) {
|
||||||
if( cudaMallocManaged((void **)&ptr,bytes) != cudaSuccess ) {
|
auto err = cudaMallocManaged((void **)&ptr,bytes);
|
||||||
|
if( err != cudaSuccess ) {
|
||||||
ptr = (_Tp *) NULL;
|
ptr = (_Tp *) NULL;
|
||||||
|
std::cerr << " cudaMallocManaged failed for " << bytes<<" bytes " <<cudaGetErrorString(err)<< std::endl;
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user