Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
cd968ae1
"git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "9d8cb8e65e091a7712b4be1dfcf987ffe6dc10f9"
Unverified
Commit
cd968ae1
authored
Oct 11, 2023
by
Artur Wojcik
Committed by
GitHub
Oct 10, 2023
Browse files
remove disabling execptions from production build (#2279)
parent
adfc74a4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
2 deletions
+18
-2
CMakeLists.txt
CMakeLists.txt
+0
-2
src/api/CMakeLists.txt
src/api/CMakeLists.txt
+4
-0
src/api/api.cpp
src/api/api.cpp
+7
-0
tools/api/api.cpp
tools/api/api.cpp
+7
-0
No files found.
CMakeLists.txt
View file @
cd968ae1
...
@@ -261,8 +261,6 @@ rocm_enable_cppcheck(
...
@@ -261,8 +261,6 @@ rocm_enable_cppcheck(
MIGRAPHX_USE_CLANG_TIDY
MIGRAPHX_USE_CLANG_TIDY
)
)
enable_testing
()
include
(
ROCMCreatePackage
)
include
(
ROCMCreatePackage
)
include
(
ROCMTest
)
include
(
ROCMTest
)
...
...
src/api/CMakeLists.txt
View file @
cd968ae1
...
@@ -32,6 +32,10 @@ migraphx_generate_export_header(migraphx_c DIRECTORY migraphx/api)
...
@@ -32,6 +32,10 @@ migraphx_generate_export_header(migraphx_c DIRECTORY migraphx/api)
# bumped when binary compatibility is broken.
# bumped when binary compatibility is broken.
rocm_set_soversion
(
migraphx_c 3.0
)
rocm_set_soversion
(
migraphx_c 3.0
)
if
(
BUILD_TESTING
)
target_compile_definitions
(
migraphx_c PRIVATE MIGRAPHX_BUILD_TESTING
)
endif
()
rocm_clang_tidy_check
(
migraphx_c
)
rocm_clang_tidy_check
(
migraphx_c
)
target_link_libraries
(
migraphx_c PRIVATE migraphx migraphx_tf migraphx_onnx
)
target_link_libraries
(
migraphx_c PRIVATE migraphx migraphx_tf migraphx_onnx
)
...
...
src/api/api.cpp
View file @
cd968ae1
...
@@ -40,24 +40,29 @@
...
@@ -40,24 +40,29 @@
#include <migraphx/convert_to_json.hpp>
#include <migraphx/convert_to_json.hpp>
#include <algorithm>
#include <algorithm>
#include <cstdarg>
#include <cstdarg>
namespace
migraphx
{
namespace
migraphx
{
#ifdef MIGRAPHX_BUILD_TESTING
static
thread_local
bool
disable_exception_catch
=
false
;
// NOLINT
static
thread_local
bool
disable_exception_catch
=
false
;
// NOLINT
extern
"C"
MIGRAPHX_C_EXPORT
void
migraphx_test_private_disable_exception_catch
(
bool
b
)
extern
"C"
MIGRAPHX_C_EXPORT
void
migraphx_test_private_disable_exception_catch
(
bool
b
)
{
{
disable_exception_catch
=
b
;
disable_exception_catch
=
b
;
}
}
#endif
template
<
class
F
>
template
<
class
F
>
migraphx_status
try_
(
F
f
,
bool
output
=
true
)
// NOLINT
migraphx_status
try_
(
F
f
,
bool
output
=
true
)
// NOLINT
{
{
#ifdef MIGRAPHX_BUILD_TESTING
if
(
disable_exception_catch
)
if
(
disable_exception_catch
)
{
{
f
();
f
();
}
}
else
else
{
{
#endif
try
try
{
{
f
();
f
();
...
@@ -81,7 +86,9 @@ migraphx_status try_(F f, bool output = true) // NOLINT
...
@@ -81,7 +86,9 @@ migraphx_status try_(F f, bool output = true) // NOLINT
{
{
return
migraphx_status_unknown_error
;
return
migraphx_status_unknown_error
;
}
}
#ifdef MIGRAPHX_BUILD_TESTING
}
}
#endif
return
migraphx_status_success
;
return
migraphx_status_success
;
}
}
...
...
tools/api/api.cpp
View file @
cd968ae1
...
@@ -40,24 +40,29 @@
...
@@ -40,24 +40,29 @@
#include <migraphx/convert_to_json.hpp>
#include <migraphx/convert_to_json.hpp>
#include <algorithm>
#include <algorithm>
#include <cstdarg>
#include <cstdarg>
namespace
migraphx
{
namespace
migraphx
{
#ifdef MIGRAPHX_BUILD_TESTING
static
thread_local
bool
disable_exception_catch
=
false
;
// NOLINT
static
thread_local
bool
disable_exception_catch
=
false
;
// NOLINT
extern
"C"
MIGRAPHX_C_EXPORT
void
migraphx_test_private_disable_exception_catch
(
bool
b
)
extern
"C"
MIGRAPHX_C_EXPORT
void
migraphx_test_private_disable_exception_catch
(
bool
b
)
{
{
disable_exception_catch
=
b
;
disable_exception_catch
=
b
;
}
}
#endif
template
<
class
F
>
template
<
class
F
>
migraphx_status
try_
(
F
f
,
bool
output
=
true
)
// NOLINT
migraphx_status
try_
(
F
f
,
bool
output
=
true
)
// NOLINT
{
{
#ifdef MIGRAPHX_BUILD_TESTING
if
(
disable_exception_catch
)
if
(
disable_exception_catch
)
{
{
f
();
f
();
}
}
else
else
{
{
#endif
try
try
{
{
f
();
f
();
...
@@ -81,7 +86,9 @@ migraphx_status try_(F f, bool output = true) // NOLINT
...
@@ -81,7 +86,9 @@ migraphx_status try_(F f, bool output = true) // NOLINT
{
{
return
migraphx_status_unknown_error
;
return
migraphx_status_unknown_error
;
}
}
#ifdef MIGRAPHX_BUILD_TESTING
}
}
#endif
return
migraphx_status_success
;
return
migraphx_status_success
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment