mirror of
				https://github.com/paboyle/Grid.git
				synced 2025-10-31 20:14:32 +00:00 
			
		
		
		
	Diagnostics on memory alloc fail
This commit is contained in:
		| @@ -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); | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user