Fixed timer

This commit is contained in:
AlexeyAB
2019-01-18 21:29:06 +03:00
parent 4ed6fd1ada
commit 0e022d0912
6 changed files with 14 additions and 21 deletions

View File

@ -136,7 +136,7 @@ $(OBJDIR)%.o: %.c $(DEPS)
$(CC) $(COMMON) $(CFLAGS) -c $< -o $@
$(OBJDIR)%.o: %.cpp $(DEPS)
$(CPP) $(COMMON) $(CFLAGS) -c $< -o $@
$(CPP) -std=c++11 $(COMMON) $(CFLAGS) -c $< -o $@
$(OBJDIR)%.o: %.cu $(DEPS)
$(NVCC) $(ARCH) $(COMMON) --compiler-options "$(CFLAGS)" -c $< -o $@

View File

@ -795,6 +795,15 @@ LIB_API tree *read_tree(char *filename);
LIB_API metadata get_metadata(char *file);
// http_stream.h
LIB_API double get_time_point();
void start_timer();
void stop_timer();
double get_time();
void stop_timer_and_show();
void stop_timer_and_show_name(char *name);
void show_total_time();
#ifdef __cplusplus
}
#endif // __cplusplus

View File

@ -17,16 +17,6 @@ extern "C" {
#include "cuda.h"
}
extern "C" {
double get_time_point();
void start_timer();
void stop_timer();
double get_time();
void stop_timer_and_show();
void stop_timer_and_show_name(char *name);
void show_total_time();
}
__global__ void binarize_kernel(float *x, int n, float *binary)
{
int i = (blockIdx.x + blockIdx.y*gridDim.x) * blockDim.x + threadIdx.x;

View File

@ -27,14 +27,6 @@ image image_data_augmentation(IplImage* ipl, int w, int h,
float jitter, float dhue, float dsat, float dexp);
#endif // OPENCV
double get_time_point();
void start_timer();
void stop_timer();
double get_time();
void stop_timer_and_show();
void stop_timer_and_show_name(char *name);
void show_total_time();
#ifdef __cplusplus
}
#endif

View File

@ -192,8 +192,6 @@ network make_network(int n)
return net;
}
double get_time_point();
void forward_network(network net, network_state state)
{
state.workspace = net.workspace;

View File

@ -786,10 +786,14 @@ network parse_network_cfg_custom(char *filename, int batch)
l = parse_avgpool(options, params);
}else if(lt == ROUTE){
l = parse_route(options, params, net);
int k;
for (k = 0; k < l.n; ++k) net.layers[l.input_layers[k]].use_bin_output = 0;
}else if (lt == UPSAMPLE) {
l = parse_upsample(options, params, net);
}else if(lt == SHORTCUT){
l = parse_shortcut(options, params, net);
net.layers[count - 1].use_bin_output = 0;
net.layers[l.index].use_bin_output = 0;
}else if(lt == DROPOUT){
l = parse_dropout(options, params);
l.output = net.layers[count-1].output;