Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
2305ac81
Commit
2305ac81
authored
Apr 23, 2018
by
Paul
Browse files
Move onnx to seperate directory
parent
fb7b72a6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
10 deletions
+46
-10
CMakeLists.txt
CMakeLists.txt
+1
-10
include/rtg/float_equal.hpp
include/rtg/float_equal.hpp
+37
-0
onnx/CMakeLists.txt
onnx/CMakeLists.txt
+8
-0
onnx/onnx.proto
onnx/onnx.proto
+0
-0
onnx/read_onnx.cpp
onnx/read_onnx.cpp
+0
-0
No files found.
CMakeLists.txt
View file @
2305ac81
...
...
@@ -13,14 +13,5 @@ add_library(rtg
)
target_include_directories
(
rtg PUBLIC $<BUILD_INTERFACE:
${
CMAKE_CURRENT_SOURCE_DIR
}
/include>
)
# Move ONNX reader to seperate directory
find_package
(
Protobuf REQUIRED
)
protobuf_generate_cpp
(
PROTO_SRCS PROTO_HDRS onnx.proto
)
include_directories
(
${
CMAKE_CURRENT_BINARY_DIR
}
)
add_executable
(
read_onnx src/read_onnx.cpp
${
PROTO_SRCS
}
)
target_include_directories
(
read_onnx PUBLIC
${
PROTOBUF_INLCUDE_DIR
}
)
target_link_libraries
(
read_onnx
${
PROTOBUF_LIBRARY
}
rtg
)
add_subdirectory
(
onnx
)
add_subdirectory
(
test
)
include/rtg/float_equal.hpp
0 → 100644
View file @
2305ac81
#ifndef GUARD_RTGLIB_FLOAT_EQUAL_HPP
#define GUARD_RTGLIB_FLOAT_EQUAL_HPP
#include <algorithm>
#include <cmath>
#include <numeric>
#ifdef _MSC_VER
#include <iso646.h>
#endif
namespace
rtg
{
template
<
class
...
Ts
>
using
common_type
=
typename
std
::
common_type
<
Ts
...
>::
type
;
struct
float_equal_fn
{
template
<
class
T
>
static
bool
apply
(
T
x
,
T
y
)
{
return
std
::
isfinite
(
x
)
and
std
::
isfinite
(
y
)
and
std
::
nextafter
(
x
,
std
::
numeric_limits
<
T
>::
lowest
())
<=
y
and
std
::
nextafter
(
x
,
std
::
numeric_limits
<
T
>::
max
())
>=
y
;
}
template
<
class
T
,
class
U
>
bool
operator
()(
T
x
,
U
y
)
const
{
return
float_equal_fn
::
apply
<
common_type
<
T
,
U
>>
(
x
,
y
);
}
};
static
constexpr
float_equal_fn
float_equal
{};
}
// namespace rtg
#endif
onnx/CMakeLists.txt
0 → 100644
View file @
2305ac81
find_package
(
Protobuf REQUIRED
)
protobuf_generate_cpp
(
PROTO_SRCS PROTO_HDRS onnx.proto
)
include_directories
(
${
CMAKE_CURRENT_BINARY_DIR
}
)
add_executable
(
read_onnx read_onnx.cpp
${
PROTO_SRCS
}
)
target_include_directories
(
read_onnx PUBLIC
${
PROTOBUF_INCLUDE_DIR
}
)
target_link_libraries
(
read_onnx
${
PROTOBUF_LIBRARY
}
rtg
)
onnx.proto
→
onnx/
onnx.proto
View file @
2305ac81
File moved
src
/read_onnx.cpp
→
onnx
/read_onnx.cpp
View file @
2305ac81
File moved
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