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
d92a1dd6
Commit
d92a1dd6
authored
5 years ago
by
Hashim Sharif
Browse files
Options
Downloads
Patches
Plain Diff
Fixing int overflow issues
parent
5c601034
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
llvm/projects/hpvm-tensor-rt/dnn_sources/include/utils.h
+6
-6
6 additions, 6 deletions
llvm/projects/hpvm-tensor-rt/dnn_sources/include/utils.h
with
6 additions
and
6 deletions
llvm/projects/hpvm-tensor-rt/dnn_sources/include/utils.h
+
6
−
6
View file @
d92a1dd6
...
@@ -327,12 +327,12 @@ struct Tensor* readTrainedWeights(const char* file_name, int data_type,
...
@@ -327,12 +327,12 @@ struct Tensor* readTrainedWeights(const char* file_name, int data_type,
struct
Tensor
*
readInputBatch
(
const
char
*
file_name
,
int
data_type
,
struct
Tensor
*
readInputBatch
(
const
char
*
file_name
,
int
data_type
,
int
start
,
int
end
,
long
int
start
,
long
int
end
,
int
dim2_size
,
int
dim3_size
,
int
dim4_size
){
long
int
dim2_size
,
long
int
dim3_size
,
long
int
dim4_size
){
int
dim1_size
=
end
-
start
;
long
int
dim1_size
=
end
-
start
;
// FIXIT: Don't assume floating point types
// FIXIT: Don't assume floating point types
int
type_size
=
4
;
// NOTE: Assuming floating point tensors
long
int
type_size
=
4
;
// NOTE: Assuming floating point tensors
long
int
num_elems
=
dim1_size
*
dim2_size
*
dim3_size
*
dim4_size
;
long
int
num_elems
=
dim1_size
*
dim2_size
*
dim3_size
*
dim4_size
;
long
int
size_in_bytes
=
type_size
*
dim1_size
*
dim2_size
*
dim3_size
*
dim4_size
;
long
int
size_in_bytes
=
type_size
*
dim1_size
*
dim2_size
*
dim3_size
*
dim4_size
;
float
*
tensor_data
=
(
float
*
)
malloc
(
sizeof
(
float
)
*
num_elems
);
float
*
tensor_data
=
(
float
*
)
malloc
(
sizeof
(
float
)
*
num_elems
);
...
@@ -364,12 +364,12 @@ struct Tensor* readInputBatch(const char* file_name, int data_type,
...
@@ -364,12 +364,12 @@ struct Tensor* readInputBatch(const char* file_name, int data_type,
void
*
copyInputBatch
(
const
char
*
file_name
,
void
*
copyInputBatch
(
const
char
*
file_name
,
int
start
,
int
end
,
int
start
,
int
end
,
int
dim2_size
,
int
dim3_size
,
int
dim4_size
,
long
int
dim2_size
,
long
int
dim3_size
,
long
int
dim4_size
,
void
*
inputTensor_ptr
){
void
*
inputTensor_ptr
){
struct
Tensor
*
inputTensor
=
(
struct
Tensor
*
)
inputTensor_ptr
;
struct
Tensor
*
inputTensor
=
(
struct
Tensor
*
)
inputTensor_ptr
;
int
dim1_size
=
end
-
start
;
long
int
dim1_size
=
end
-
start
;
// FIXIT: Don't assume floating point types
// FIXIT: Don't assume floating point types
int
type_size
=
4
;
// NOTE: Assuming floating point tensors
int
type_size
=
4
;
// NOTE: Assuming floating point tensors
long
int
num_elems
=
dim1_size
*
dim2_size
*
dim3_size
*
dim4_size
;
long
int
num_elems
=
dim1_size
*
dim2_size
*
dim3_size
*
dim4_size
;
...
...
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