Viskores  1.0
ThrustExceptionHandler.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 #ifndef viskores_cont_cuda_interal_ThrustExecptionHandler_h
19 #define viskores_cont_cuda_interal_ThrustExecptionHandler_h
20 
24 
27 #include <thrust/system_error.h>
29 
30 namespace viskores
31 {
32 namespace cont
33 {
34 namespace cuda
35 {
36 namespace internal
37 {
38 
39 static inline void throwAsViskoresException()
40 {
41  try
42  {
43  //re-throw the last exception
44  throw;
45  }
46  catch (std::bad_alloc& error)
47  {
48  throw viskores::cont::ErrorBadAllocation(error.what());
49  }
50  catch (thrust::system_error& error)
51  {
52  throw viskores::cont::ErrorExecution(error.what());
53  }
54 }
55 }
56 }
57 }
58 }
59 
60 #endif //viskores_cont_cuda_interal_ThrustExecptionHandler_h
ErrorBadAllocation.h
viskores::cont::ErrorBadAllocation
This class is thrown when Viskores attempts to manipulate memory that it should not.
Definition: ErrorBadAllocation.h:33
viskores::cont::ErrorExecution
This class is thrown in the control environment whenever an error occurs in the execution environment...
Definition: ErrorExecution.h:33
VISKORES_THIRDPARTY_POST_INCLUDE
#define VISKORES_THIRDPARTY_POST_INCLUDE
Definition: Configure.h:200
ThrustPatches.h
ExportMacros.h
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
ErrorExecution.h
VISKORES_THIRDPARTY_PRE_INCLUDE
#define VISKORES_THIRDPARTY_PRE_INCLUDE
Definition: Configure.h:199