Commit c92c3e51 by chengshuyao

Debug for very long input bit vec

parent 132c28bc
......@@ -51,7 +51,7 @@ public:
//BSD内部使用的变量(固定)
const double total_weight_max = pow(2.0,20); //指导权重分布修改
const int total_sample_max = 1000000000; //指导采样个数修改
const int BSD_samples_influence_max = min(parameter_max_samples,10*parameter_num_threads); //BSD确定展开序的置信度
const int BSD_samples_influence_max = min(parameter_max_samples,10); //BSD确定展开序的置信度
int which_demo_function ;
int BDD_id;
......@@ -1100,13 +1100,13 @@ int BDD_class::train_BDD(int start_depth, int how_many_start_nodes, BDD_node* st
int BDD_class::BDD_infer(){
long i,j;
gettimeofday(&start_time,NULL);
random_device rd;
mt19937 gen(rd());
cout<<"test dataset size = "<<parameter_test_ios<<endl;
error_amount_all = 0;
bool* error_all = new bool [how_many_start_nodes*parameter_test_ios];
gettimeofday(&start_time,NULL);
#pragma omp parallel for
for(long zj=0;zj<how_many_start_nodes*parameter_test_ios;zj++){
int test_bit = int(zj/parameter_test_ios);
......@@ -1138,6 +1138,7 @@ int BDD_class::BDD_infer(){
/////}
arr_delete (test_input_data);
}
gettimeofday(&finish_time,NULL);
cout<<endl;
circuit_accuracy_all_bits = new double [how_many_start_nodes];
for(int test_bit=0;test_bit<how_many_start_nodes;test_bit++){
......@@ -1163,7 +1164,6 @@ int BDD_class::BDD_infer(){
cout<<most_influence[i]<<" ";
}
cout<<endl;
gettimeofday(&finish_time,NULL);
double test_time = double(finish_time.tv_usec-start_time.tv_usec+1000000*(finish_time.tv_sec-start_time.tv_sec))/1000000;
cout<<"Total test time = "<<test_time<<"s"<<endl;
arr_delete (error_all);
......
......@@ -3,7 +3,7 @@ int BDD_class::print_circuit(int node_depth, char* start_node_index_string){
int i,j;
int zi;
char output_file_name[100];
char* output_file_name = new char [100+parameter_output_bit_width];
//sprintf(output_file_name,"rtl/module_output_bit_%d.v",which_bit_output);
// sprintf(output_file_name,"rtl/function_%d_id_%d.v",circuit_index,BDD_id);
sprintf(output_file_name,"rtl/function_layer_%d_nodes_%s.v",node_depth, start_node_index_string);
......
#include "head.h"
#include "io_generator/c17.h" //io_generator中需要包含对PI_WIDTH,PO_WIDTH的全局定义,如: extern const int PI_WIDTH = 36;
#include "io_generator/rob_bsd.h" //io_generator中需要包含对PI_WIDTH,PO_WIDTH的全局定义,如: extern const int PI_WIDTH = 36;
......@@ -16,7 +16,7 @@ int parameter_output_bit_width = PO_WIDTH;
extern const int parameter_search_iterations = 10; //最大设计次数
extern const int parameter_test_ios = 1000000; //测试要求多少样本
extern const int parameter_test_ios = 100000; //测试要求多少样本
extern const int parameter_max_samples = 1000; //BSD每一个节点最多进行多少次采样,至少为64
extern const double parameter_early_stop_accuracy = 1; //允许的错误率,如果完全不允许,设为1;
//没有特殊需要不要设到<1,会慢一些。
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment