Give a better message when out of memory in allocating SliceUnion
This commit is contained in:
parent
5678ac0d9c
commit
a5bb8f3d9c
@ -412,10 +412,17 @@ template <typename F=double>
|
|||||||
|
|
||||||
for (auto& ptr: sliceBuffers) {
|
for (auto& ptr: sliceBuffers) {
|
||||||
#if defined(HAVE_CUDA)
|
#if defined(HAVE_CUDA)
|
||||||
|
const CUresult error =
|
||||||
cuMemAlloc(&ptr, sizeof(F) * sources[0].size());
|
cuMemAlloc(&ptr, sizeof(F) * sources[0].size());
|
||||||
if (ptr == 0UL) {
|
if (ptr == 0UL) {
|
||||||
throw "UNSUFICCIENT MEMORY ON THE GRAPHIC CARD FOR FREE POINTERS";
|
throw "UNSUFICCIENT MEMORY ON THE GRAPHIC CARD FOR FREE POINTERS";
|
||||||
}
|
}
|
||||||
|
if (error != CUDA_SUCCESS) {
|
||||||
|
std::stringstream s;
|
||||||
|
s << "Error allocating memory for slice buffers "
|
||||||
|
<< "code " << error << "\n";
|
||||||
|
throw s.str();
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
ptr = (DataPtr<F>)malloc(sizeof(F) * sources[0].size());
|
ptr = (DataPtr<F>)malloc(sizeof(F) * sources[0].size());
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user