Replace ErrorControlOutOfMemory with ErrorControlBadAllocation.

This commit is contained in:
Robert Maynard 2015-10-01 14:25:28 -04:00
parent 085711e2d2
commit f38673f618
13 changed files with 19 additions and 62 deletions

@ -28,7 +28,6 @@
#include <vtkm/cont/ArrayHandlePermutation.h>
#include <vtkm/cont/ArrayHandleZip.h>
#include <vtkm/cont/ArrayPortalToIterators.h>
#include <vtkm/cont/ErrorControlOutOfMemory.h>
#include <vtkm/cont/ErrorExecution.h>
#include <vtkm/cont/StorageBasic.h>
#include <vtkm/cont/Timer.h>

@ -258,7 +258,7 @@ public:
///
/// The allocation may be done on an already existing array, but can wipe out
/// any data already in the array. This method can throw
/// ErrorControlOutOfMemory if the array cannot be allocated or
/// ErrorControlBadAllocation if the array cannot be allocated or
/// ErrorControlBadValue if the allocation is not feasible (for example, the
/// array storage is read-only).
///

@ -55,7 +55,6 @@ set(headers
ErrorControlBadType.h
ErrorControlBadValue.h
ErrorControlInternal.h
ErrorControlOutOfMemory.h
ErrorExecution.h
Field.h
LogicalStructure.h

@ -1,41 +0,0 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2014 Sandia Corporation.
// Copyright 2014 UT-Battelle, LLC.
// Copyright 2014 Los Alamos National Security.
//
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtk_m_cont_ErrorControlOutOfMemory_h
#define vtk_m_cont_ErrorControlOutOfMemory_h
#include <vtkm/cont/ErrorControl.h>
namespace vtkm {
namespace cont {
/// This class is thrown when a vtkm function or method tries to allocate an
/// array and fails.
///
class ErrorControlOutOfMemory : public ErrorControl
{
public:
ErrorControlOutOfMemory(const std::string &message)
: ErrorControl(message) { }
};
}
} // namespace vtkm::cont
#endif //vtk_m_cont_ErrorControlOutOfMemory_h

@ -131,7 +131,7 @@ public:
///
/// The allocation may be done on an already existing array, but can wipe out
/// any data already in the array. This method can throw
/// ErrorControlOutOfMemory if the array cannot be allocated or
/// ErrorControlBadAllocation if the array cannot be allocated or
/// ErrorControlBadValue if the allocation is not feasible (for example, the
/// array storage is read-only).
///

@ -23,7 +23,7 @@
#include <vtkm/Types.h>
#include <vtkm/cont/Assert.h>
#include <vtkm/cont/ErrorControlBadValue.h>
#include <vtkm/cont/ErrorControlOutOfMemory.h>
#include <vtkm/cont/ErrorControlBadAllocation.h>
#include <vtkm/cont/Storage.h>
#include <vtkm/cont/internal/ArrayPortalFromIterators.h>
@ -284,7 +284,7 @@ public:
this->Array = NULL;
this->NumberOfValues = 0;
this->AllocatedSize = 0;
throw vtkm::cont::ErrorControlOutOfMemory(
throw vtkm::cont::ErrorControlBadAllocation(
"Could not allocate basic control array.");
}

@ -58,7 +58,7 @@ public:
{
return this->Superclass::PrepareForInput(updateData);
}
catch (vtkm::cont::ErrorControlOutOfMemory error)
catch (vtkm::cont::ErrorControlBadAllocation error)
{
// Thrust does not seem to be clearing the CUDA error, so do it here.
cudaError_t cudaError = cudaPeekAtLastError();
@ -77,7 +77,7 @@ public:
{
return this->Superclass::PrepareForInPlace(updateData);
}
catch (vtkm::cont::ErrorControlOutOfMemory error)
catch (vtkm::cont::ErrorControlBadAllocation error)
{
// Thrust does not seem to be clearing the CUDA error, so do it here.
cudaError_t cudaError = cudaPeekAtLastError();
@ -96,7 +96,7 @@ public:
{
return this->Superclass::PrepareForOutput(numberOfValues);
}
catch (vtkm::cont::ErrorControlOutOfMemory error)
catch (vtkm::cont::ErrorControlBadAllocation error)
{
// Thrust does not seem to be clearing the CUDA error, so do it here.
cudaError_t cudaError = cudaPeekAtLastError();

@ -21,7 +21,7 @@
#define vtk_m_cont_cuda_internal_ArrayManagerExecutionThrustDevice_h
#include <vtkm/cont/ArrayPortalToIterators.h>
#include <vtkm/cont/ErrorControlOutOfMemory.h>
#include <vtkm/cont/ErrorControlBadAllocation.h>
#include <vtkm/cont/Storage.h>
// Disable warnings we check vtkm for but Thrust does not.
@ -153,7 +153,7 @@ public:
}
catch (std::bad_alloc error)
{
throw vtkm::cont::ErrorControlOutOfMemory(error.what());
throw vtkm::cont::ErrorControlBadAllocation(error.what());
}
return PortalType(this->Array.data(),

@ -21,7 +21,7 @@
#define vtk_m_cont_cuda_interal_ThrustExecptionHandler_h
#include <vtkm/internal/ExportMacros.h>
#include <vtkm/cont/ErrorControlOutOfMemory.h>
#include <vtkm/cont/ErrorControlBadAllocation.h>
#include <vtkm/cont/ErrorExecution.h>
VTKM_THIRDPARTY_PRE_INCLUDE
@ -43,7 +43,7 @@ static inline void throwAsVTKmException()
}
catch(std::bad_alloc &error)
{
throw vtkm::cont::ErrorControlOutOfMemory(error.what());
throw vtkm::cont::ErrorControlBadAllocation(error.what());
}
catch(thrust::system_error &error)
{

@ -24,7 +24,7 @@
#include <vtkm/cont/ArrayPortal.h>
#include <vtkm/cont/ArrayPortalToIterators.h>
#include <vtkm/cont/Assert.h>
#include <vtkm/cont/ErrorControlOutOfMemory.h>
#include <vtkm/cont/ErrorControlBadAllocation.h>
#include <iterator>
#include <limits>
@ -55,7 +55,7 @@ public:
#ifndef VTKM_USE_64BIT_IDS
if (numberOfValues > std::numeric_limits<vtkm::Id>::max())
{
throw vtkm::cont::ErrorControlOutOfMemory(
throw vtkm::cont::ErrorControlBadAllocation(
"Distance of iterators larger than maximum array size. "
"To support larger arrays, try turning on VTKM_USE_64BIT_IDS.");
}

@ -28,7 +28,7 @@
#include <vtkm/cont/ArrayHandlePermutation.h>
#include <vtkm/cont/ArrayHandleZip.h>
#include <vtkm/cont/ArrayPortalToIterators.h>
#include <vtkm/cont/ErrorControlOutOfMemory.h>
#include <vtkm/cont/ErrorControlBadAllocation.h>
#include <vtkm/cont/ErrorExecution.h>
#include <vtkm/cont/StorageBasic.h>
#include <vtkm/cont/Timer.h>
@ -355,7 +355,7 @@ private:
"or the width of vtkm::Id is not large enough to express all "
"array sizes.");
}
catch (vtkm::cont::ErrorControlOutOfMemory error)
catch (vtkm::cont::ErrorControlBadAllocation error)
{
std::cout << "Got the expected error: " << error.GetMessage() << std::endl;
}

@ -21,7 +21,7 @@
#define vtkm_opengl_cuda_internal_TransferToOpenGL_h
#include <vtkm/cont/ErrorExecution.h>
#include <vtkm/cont/ErrorControlOutOfMemory.h>
#include <vtkm/cont/ErrorControlBadAllocation.h>
#include <vtkm/cont/cuda/internal/DeviceAdapterTagCuda.h>
#include <vtkm/cont/cuda/internal/MakeThrustIterator.h>
@ -96,7 +96,7 @@ public:
cError =cudaGraphicsMapResources(1,&cudaResource);
if(cError != cudaSuccess)
{
throw vtkm::cont::ErrorControlOutOfMemory(
throw vtkm::cont::ErrorControlBadAllocation(
"Could not allocate enough memory in CUDA for OpenGL interop.");
}

@ -77,7 +77,7 @@ private:
{
vtkm::opengl::TransferToOpenGL(array,handle, DeviceAdapterTag());
}
catch (vtkm::cont::ErrorControlOutOfMemory error)
catch (vtkm::cont::ErrorControlBadAllocation error)
{
std::cout << error.GetMessage() << std::endl;
VTKM_TEST_ASSERT(true==false,
@ -99,7 +99,7 @@ private:
{
vtkm::opengl::TransferToOpenGL(array,handle,type, DeviceAdapterTag());
}
catch (vtkm::cont::ErrorControlOutOfMemory error)
catch (vtkm::cont::ErrorControlBadAllocation error)
{
std::cout << error.GetMessage() << std::endl;
VTKM_TEST_ASSERT(true==false,