Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aidge_core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Cyril Moineau
aidge_core
Commits
56cad8c2
Commit
56cad8c2
authored
1 year ago
by
Olivier BICHLER
Browse files
Options
Downloads
Patches
Plain Diff
Fixed Clang compiler errors
parent
29640647
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/aidge/operator/Producer.hpp
+2
-2
2 additions, 2 deletions
include/aidge/operator/Producer.hpp
include/aidge/utils/StaticAttributes.hpp
+6
-6
6 additions, 6 deletions
include/aidge/utils/StaticAttributes.hpp
with
8 additions
and
8 deletions
include/aidge/operator/Producer.hpp
+
2
−
2
View file @
56cad8c2
...
@@ -121,11 +121,11 @@ public:
...
@@ -121,11 +121,11 @@ public:
inline
const
std
::
vector
<
DimSize_t
>
dims
()
const
noexcept
{
return
mOutput
->
dims
();
}
inline
const
std
::
vector
<
DimSize_t
>
dims
()
const
noexcept
{
return
mOutput
->
dims
();
}
void
setBackend
(
const
std
::
string
&
name
)
{
void
setBackend
(
const
std
::
string
&
name
)
override
{
mImpl
=
Registrar
<
Producer_Op
>::
create
(
name
)(
*
this
);
mImpl
=
Registrar
<
Producer_Op
>::
create
(
name
)(
*
this
);
mOutput
->
setBackend
(
name
);
mOutput
->
setBackend
(
name
);
}
}
void
setDatatype
(
const
DataType
&
datatype
)
{
void
setDatatype
(
const
DataType
&
datatype
)
override
{
mOutput
->
setDatatype
(
datatype
);
mOutput
->
setDatatype
(
datatype
);
}
}
...
...
This diff is collapsed.
Click to expand it.
include/aidge/utils/StaticAttributes.hpp
+
6
−
6
View file @
56cad8c2
...
@@ -87,7 +87,7 @@ public:
...
@@ -87,7 +87,7 @@ public:
// Runtime access with name
// Runtime access with name
template
<
typename
R
>
template
<
typename
R
>
constexpr
R
&
getAttr
(
const
char
*
name
)
{
R
&
getAttr
(
const
char
*
name
)
{
for
(
std
::
size_t
i
=
0
;
i
<
size
(
EnumStrings
<
ATTRS_ENUM
>::
data
);
++
i
)
{
for
(
std
::
size_t
i
=
0
;
i
<
size
(
EnumStrings
<
ATTRS_ENUM
>::
data
);
++
i
)
{
if
(
strcmp
(
EnumStrings
<
ATTRS_ENUM
>::
data
[
i
],
name
)
==
0
)
{
if
(
strcmp
(
EnumStrings
<
ATTRS_ENUM
>::
data
[
i
],
name
)
==
0
)
{
return
getAttr
<
R
>
(
i
);
return
getAttr
<
R
>
(
i
);
...
@@ -98,7 +98,7 @@ public:
...
@@ -98,7 +98,7 @@ public:
}
}
template
<
typename
R
,
std
::
size_t
SIZE
=
std
::
tuple_size
<
std
::
tuple
<
T
...>
>::
value
>
template
<
typename
R
,
std
::
size_t
SIZE
=
std
::
tuple_size
<
std
::
tuple
<
T
...>
>::
value
>
constexpr
typename
std
::
enable_if
<
(
SIZE
>
0
),
R
&>::
type
getAttr
(
std
::
size_t
i
)
{
typename
std
::
enable_if
<
(
SIZE
>
0
),
R
&>::
type
getAttr
(
std
::
size_t
i
)
{
if
(
i
==
SIZE
-
1
)
{
if
(
i
==
SIZE
-
1
)
{
if
(
std
::
is_same
<
R
,
typename
std
::
tuple_element
<
SIZE
-
1
,
std
::
tuple
<
T
...
>>::
type
>::
value
)
{
if
(
std
::
is_same
<
R
,
typename
std
::
tuple_element
<
SIZE
-
1
,
std
::
tuple
<
T
...
>>::
type
>::
value
)
{
return
reinterpret_cast
<
R
&>
(
std
::
get
<
SIZE
-
1
>
(
mAttrs
));
return
reinterpret_cast
<
R
&>
(
std
::
get
<
SIZE
-
1
>
(
mAttrs
));
...
@@ -113,7 +113,7 @@ public:
...
@@ -113,7 +113,7 @@ public:
}
}
template
<
typename
R
,
std
::
size_t
SIZE
=
std
::
tuple_size
<
std
::
tuple
<
T
...>
>::
value
>
template
<
typename
R
,
std
::
size_t
SIZE
=
std
::
tuple_size
<
std
::
tuple
<
T
...>
>::
value
>
[[
noreturn
]]
constexpr
typename
std
::
enable_if
<
(
SIZE
==
0
),
R
&>::
type
getAttr
(
std
::
size_t
/*i*/
)
{
[[
noreturn
]]
typename
std
::
enable_if
<
(
SIZE
==
0
),
R
&>::
type
getAttr
(
std
::
size_t
/*i*/
)
{
AIDGE_THROW_OR_ABORT
(
std
::
runtime_error
,
"attribute not found"
);
AIDGE_THROW_OR_ABORT
(
std
::
runtime_error
,
"attribute not found"
);
}
}
...
@@ -128,7 +128,7 @@ public:
...
@@ -128,7 +128,7 @@ public:
}
}
template
<
std
::
size_t
SIZE
=
std
::
tuple_size
<
std
::
tuple
<
T
...>
>::
value
>
template
<
std
::
size_t
SIZE
=
std
::
tuple_size
<
std
::
tuple
<
T
...>
>::
value
>
[[
noreturn
]]
constexpr
typename
std
::
enable_if
<
(
SIZE
==
0
),
const
std
::
type_info
&>::
type
getAttrType
(
std
::
size_t
/*i*/
)
const
{
[[
noreturn
]]
typename
std
::
enable_if
<
(
SIZE
==
0
),
const
std
::
type_info
&>::
type
getAttrType
(
std
::
size_t
/*i*/
)
const
{
AIDGE_THROW_OR_ABORT
(
std
::
runtime_error
,
"attribute not found"
);
AIDGE_THROW_OR_ABORT
(
std
::
runtime_error
,
"attribute not found"
);
}
}
...
@@ -140,7 +140,7 @@ public:
...
@@ -140,7 +140,7 @@ public:
/// Generic Attributes API
/// Generic Attributes API
//////////////////////////////////////
//////////////////////////////////////
// Runtime existance check with name
// Runtime existance check with name
constexpr
bool
hasAttr
(
const
std
::
string
&
name
)
const
override
final
{
bool
hasAttr
(
const
std
::
string
&
name
)
const
override
final
{
for
(
std
::
size_t
i
=
0
;
i
<
size
(
EnumStrings
<
ATTRS_ENUM
>::
data
);
++
i
)
{
for
(
std
::
size_t
i
=
0
;
i
<
size
(
EnumStrings
<
ATTRS_ENUM
>::
data
);
++
i
)
{
if
(
name
==
EnumStrings
<
ATTRS_ENUM
>::
data
[
i
])
{
if
(
name
==
EnumStrings
<
ATTRS_ENUM
>::
data
[
i
])
{
return
true
;
return
true
;
...
@@ -151,7 +151,7 @@ public:
...
@@ -151,7 +151,7 @@ public:
}
}
// Runtime type access with name
// Runtime type access with name
constexpr
std
::
string
getAttrType
(
const
std
::
string
&
name
)
const
override
final
{
std
::
string
getAttrType
(
const
std
::
string
&
name
)
const
override
final
{
for
(
std
::
size_t
i
=
0
;
i
<
size
(
EnumStrings
<
ATTRS_ENUM
>::
data
);
++
i
)
{
for
(
std
::
size_t
i
=
0
;
i
<
size
(
EnumStrings
<
ATTRS_ENUM
>::
data
);
++
i
)
{
if
(
name
==
EnumStrings
<
ATTRS_ENUM
>::
data
[
i
])
{
if
(
name
==
EnumStrings
<
ATTRS_ENUM
>::
data
[
i
])
{
return
getAttrType
(
i
).
name
();
return
getAttrType
(
i
).
name
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment