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
02f526c0
Commit
02f526c0
authored
3 years ago
by
Hashim Sharif
Browse files
Options
Downloads
Patches
Plain Diff
Adding dummy tensorUtils.h and tensor.h for NVDLA compilation
parent
c277da3d
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
hpvm/include/nvdla/tensor.h
+27
-0
27 additions, 0 deletions
hpvm/include/nvdla/tensor.h
hpvm/include/nvdla/tensorUtils.h
+51
-0
51 additions, 0 deletions
hpvm/include/nvdla/tensorUtils.h
hpvm/tools/hpvm-clang/CMakeLists.txt
+2
-0
2 additions, 0 deletions
hpvm/tools/hpvm-clang/CMakeLists.txt
with
80 additions
and
0 deletions
hpvm/include/nvdla/tensor.h
0 → 100644
+
27
−
0
View file @
02f526c0
#ifndef TENSOR_HEADER
#define TENSOR_HEADER
struct
Dimension
{
int
num_dims
;
size_t
*
dim_sizes
;
};
enum
data_location_t
{
HOST
,
DEVICE
};
struct
Tensor
{
int
data_type
;
int
cur_type
;
int
data_format
;
data_location_t
data_placement
;
// Maintains the location of the tensor {host, device...}
void
*
host_data
;
void
*
gpu_data
;
// Pointer to GPU FP32 data
void
*
gpu_half_data
;
// Pointer to GPU FP16 data
size_t
num_elems
;
// Total elements
size_t
size_in_bytes
;
// Total size in bytes
struct
Dimension
dims
;
};
#endif
This diff is collapsed.
Click to expand it.
hpvm/include/nvdla/tensorUtils.h
0 → 100644
+
51
−
0
View file @
02f526c0
// Header guards
#ifndef UTILS_HEADER
#define UTILS_HEADER
#include
"tensor.h"
#include
<vector>
std
::
vector
<
float
>
run_accuracies
;
std
::
string
model_params_path
=
"../../test/dnn_benchmarks/model_params/"
;
struct
Tensor
*
readTrainedWeights
(
const
char
*
file_name
,
int
data_type
,
long
int
dim1_size
,
long
int
dim2_size
,
long
int
dim3_size
,
long
int
dim4_size
)
{
}
struct
Tensor
*
readInputBatch
(
const
char
*
file_name
,
long
data_type
,
long
start
,
long
end
,
long
dim2_size
,
long
dim3_size
,
long
dim4_size
)
{
}
uint8_t
*
readLabels
(
const
char
*
labels_file
,
int
num_labels
)
{
}
uint32_t
*
readLabels3
(
const
char
*
labels_file
,
int
num_labels
)
{
}
uint32_t
*
readLabelsBatch3
(
const
char
*
labels_file
,
int
start
,
int
end
)
{
}
float
computeAccuracy3
(
uint32_t
*
labels
,
void
*
result_ptr
)
{
}
#endif
This diff is collapsed.
Click to expand it.
hpvm/tools/hpvm-clang/CMakeLists.txt
+
2
−
0
View file @
02f526c0
...
...
@@ -31,6 +31,8 @@ else()
endif
()
list
(
APPEND INCLUDE_DIRS
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../include
)
list
(
APPEND INCLUDE_DIRS
${
CMAKE_CURRENT_SOURCE_DIR
}
/../../include/nvdla/
)
if
(
${
HPVM_USE_OPENCL
}
)
# We need to link to OpenCL libs when hpvm uses opencl
...
...
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