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
541967f1
Commit
541967f1
authored
11 months ago
by
Olivier BICHLER
Committed by
Maxence Naud
11 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Improved specifications
parent
48ecdca1
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/backend/cpu/data/TensorImpl.hpp
+2
-0
2 additions, 0 deletions
include/aidge/backend/cpu/data/TensorImpl.hpp
include/aidge/data/Tensor.hpp
+2
-0
2 additions, 0 deletions
include/aidge/data/Tensor.hpp
with
4 additions
and
0 deletions
include/aidge/backend/cpu/data/TensorImpl.hpp
+
2
−
0
View file @
541967f1
...
...
@@ -23,6 +23,8 @@ namespace Aidge {
template
<
class
T
>
class
TensorImpl_cpu
:
public
TensorImpl
{
static_assert
(
std
::
is_trivially_copyable
<
T
>::
value
,
"TensorImpl type should be trivially copyable"
);
private:
/// Pointer to the data and its capacity
future_std
::
span
<
T
>
mData
;
...
...
This diff is collapsed.
Click to expand it.
include/aidge/data/Tensor.hpp
+
2
−
0
View file @
541967f1
...
...
@@ -529,6 +529,7 @@ public:
template
<
typename
expectedType
>
const
expectedType
&
get
(
std
::
size_t
idx
)
const
{
AIDGE_ASSERT
(
NativeType
<
expectedType
>::
type
==
mDataType
,
"wrong data type"
);
AIDGE_ASSERT
(
mImpl
->
hostPtr
()
!=
nullptr
,
"get() can only be used for backends providing a valid host pointer"
);
AIDGE_ASSERT
(
idx
<
mSize
,
"idx out of range"
);
return
*
reinterpret_cast
<
expectedType
*>
(
mImpl
->
hostPtr
(
mImplOffset
+
idx
));
}
...
...
@@ -541,6 +542,7 @@ public:
template
<
typename
expectedType
>
void
set
(
std
::
size_t
idx
,
expectedType
value
){
AIDGE_ASSERT
(
NativeType
<
expectedType
>::
type
==
mDataType
,
"wrong data type"
);
AIDGE_ASSERT
(
mImpl
->
hostPtr
()
!=
nullptr
,
"get() can only be used for backends providing a valid host pointer"
);
AIDGE_ASSERT
(
idx
<
mSize
,
"idx out of range"
);
expectedType
*
dataPtr
=
static_cast
<
expectedType
*>
(
mImpl
->
hostPtr
(
mImplOffset
+
idx
));
*
dataPtr
=
value
;
...
...
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