Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hpvm-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
llvm
hpvm-release
Commits
0a4677bd
Commit
0a4677bd
authored
5 years ago
by
Elizabeth
Browse files
Options
Downloads
Patches
Plain Diff
Fixing tensor sizes assertion
parent
dc823cd1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
llvm/projects/hpvm-tensor-rt/tensor_runtime/include/tensor_utils.cu
+9
-3
9 additions, 3 deletions
...cts/hpvm-tensor-rt/tensor_runtime/include/tensor_utils.cu
with
9 additions
and
3 deletions
llvm/projects/hpvm-tensor-rt/tensor_runtime/include/tensor_utils.cu
+
9
−
3
View file @
0a4677bd
...
@@ -329,12 +329,18 @@ extern "C"{
...
@@ -329,12 +329,18 @@ extern "C"{
void
initTensorData
(
void
*
tensor_ptr
,
void
*
data_ptr
,
size_t
size_in_bytes
){
void
initTensorData
(
void
*
tensor_ptr
,
void
*
data_ptr
,
size_t
size_in_bytes
){
Tensor
*
tensor
=
(
Tensor
*
)
tensor_ptr
;
Tensor
*
tensor
=
(
Tensor
*
)
tensor_ptr
;
if
(
tensor
->
size_in_bytes
!=
size_in_bytes
){
size_t
host_size_in_bytes
=
tensor
->
num_elems
*
4
;
//if(tensor->size_in_bytes != size_in_bytes){
if
(
host_size_in_bytes
!=
size_in_bytes
){
ERROR
(
"The destination and source sizes don't match"
);
ERROR
(
"The destination and source sizes don't match"
);
}
}
std
::
memcpy
(
tensor
->
host_data
,
data_ptr
,
size_in_bytes
);
std
::
memcpy
(
tensor
->
host_data
,
data_ptr
,
size_in_bytes
);
changeTensorPlacement
(
tensor
,
HOST
);
tensor
->
cur_type
=
float_type
;
}
}
...
@@ -428,7 +434,7 @@ extern "C"{
...
@@ -428,7 +434,7 @@ extern "C"{
bool
ONLINE_PROFILING
=
false
;
bool
ONLINE_PROFILING
=
false
;
// true;
void
convertToFP16
(
struct
Tensor
*
tensor
){
void
convertToFP16
(
struct
Tensor
*
tensor
){
...
...
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