Skip to content
Snippets Groups Projects
Commit 02f526c0 authored by Hashim Sharif's avatar Hashim Sharif
Browse files

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
#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
// 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
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment