STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
amprt_exceptions.h
Go to the documentation of this file.
1 /***
2 * ==++==
3 *
4 * Copyright (c) Microsoft Corporation. All rights reserved.
5 *
6 * ==--==
7 * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
8 *
9 * amprt_exceptions.h
10 *
11 * Define the C++ interfaces exported by the C++ AMP runtime
12 *
13 * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
14 ****/
15 #pragma once
16 
17 #include <exception>
18 
19 #if !defined(_AMPIMP)
20 #define _AMPIMP __declspec(dllimport)
21 #endif
22 
23 // exceptions
24 namespace Concurrency {
29 class runtime_exception : public std::exception
30 {
31 public:
41  _AMPIMP runtime_exception(const char * _Message, HRESULT _Hresult) throw();
42 
49  _AMPIMP explicit runtime_exception(HRESULT _Hresult) throw();
50 
57  _AMPIMP runtime_exception(const runtime_exception &_Other) throw();
58 
65  _AMPIMP runtime_exception &operator=(const runtime_exception &_Other) throw();
66 
70  _AMPIMP virtual ~runtime_exception() throw();
71 
78  _AMPIMP HRESULT get_error_code() const throw();
79 
80 private:
81  HRESULT _M_error_code;
82 }; // class runtime_exception
83 
89 {
90 public:
97  _AMPIMP explicit out_of_memory(const char * _Message) throw();
98 
102  _AMPIMP out_of_memory () throw();
103 }; // class out_of_memory
104 
110 {
111 public:
122  _AMPIMP explicit accelerator_view_removed(const char * _Message, HRESULT _View_removed_reason) throw();
123 
130  _AMPIMP explicit accelerator_view_removed(HRESULT _View_removed_reason) throw();
131 
138  _AMPIMP HRESULT get_view_removed_reason() const throw();
139 
140 private:
141 
143 }; // class accelerator_view_removed
144 
150 {
151 public:
158  _AMPIMP explicit invalid_compute_domain(const char * _Message) throw();
159 
164 }; // class invalid_compute_domain
165 
170 {
171 public:
178  _AMPIMP explicit unsupported_feature(const char * _Message) throw();
179 
183  _AMPIMP unsupported_feature() throw();
184 }; // class unsupported_feature
185 }
HRESULT _M_error_code
Definition: amprt_exceptions.h:81
virtual _AMPIMP ~runtime_exception()
Destruct a runtime_exception exception object instance
_AMPIMP runtime_exception(const char *_Message, HRESULT _Hresult)
Construct a runtime_exception exception with a message and an error code
_AMPIMP out_of_memory()
Construct an out_of_memory exception
Exception thrown when an underlying OS/DirectX call fails due to lack of system or device memory ...
Definition: amprt_exceptions.h:88
The Concurrency namespace provides classes and functions that provide access to the Concurrency Runti...
Definition: agents.h:43
_AMPIMP HRESULT get_error_code() const
Get the error code that caused this exception
Exception thrown due to a C++ AMP runtime_exception. This is the base type for all C++ AMP exception ...
Definition: amprt_exceptions.h:29
#define _AMPIMP
Definition: amprt_exceptions.h:20
Exception thrown when an underlying DirectX call fails due to the Windows timeout detection and recov...
Definition: amprt_exceptions.h:109
_AMPIMP accelerator_view_removed(const char *_Message, HRESULT _View_removed_reason)
Construct an accelerator_view_removed exception with a message and a view removed reason code ...
_AMPIMP HRESULT get_view_removed_reason() const
Returns an HRESULT error code indicating the cause of the accelerator_view's removal ...
_AMPIMP invalid_compute_domain()
Construct an invalid_compute_domain exception
Exception thrown when an unsupported feature is used
Definition: amprt_exceptions.h:169
_AMPIMP unsupported_feature()
Construct an unsupported_feature exception
Exception thrown when the runtime fails to launch a kernel using the compute domain specified at the ...
Definition: amprt_exceptions.h:149
_AMPIMP runtime_exception & operator=(const runtime_exception &_Other)
Assignment operator
HRESULT _M_view_removed_reason_code
Definition: amprt_exceptions.h:142