-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #217 from MicheleCancilla/develop
Fix compilation for Windows
- Loading branch information
Showing
9 changed files
with
110 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,33 @@ | ||
#ifndef _PROFILING | ||
/* | ||
* EDDL Library - European Distributed Deep Learning Library. | ||
* Version: 0.7 | ||
* copyright (c) 2020, Universidad Polit�cnica de Valencia (UPV), PRHLT Research Centre | ||
* Date: April 2020 | ||
* Author: PRHLT Research Centre, UPV, ([email protected]), ([email protected]) | ||
* All rights reserved | ||
*/ | ||
|
||
#ifndef _PROFILING | ||
#define _PROFILING | ||
|
||
#include "eddl/system_info.h" | ||
|
||
#ifdef EDDL_WINDOWS | ||
|
||
#include <chrono> | ||
#include <windows.h> | ||
#include <winsock.h> | ||
|
||
int gettimeofday(struct timeval* tp, struct timezone* tzp); | ||
|
||
#else | ||
#include <sys/time.h> | ||
#endif | ||
|
||
#define PROFILING_HEADER(fn) \ | ||
struct timeval prof_t1; \ | ||
gettimeofday(&prof_t1, NULL); | ||
|
||
|
||
#define PROFILING_ENABLE(fn) \ | ||
unsigned long long prof_##fn##_time; \ | ||
unsigned long long prof_##fn##_calls; | ||
|
@@ -44,13 +63,10 @@ | |
100.0 * prof_##fn##_time / acc, (float) prof_##fn##_time / (float) prof_##fn##_calls); | ||
#endif | ||
|
||
|
||
|
||
//CxHxW | ||
// | ||
//HxWxC | ||
// | ||
//GxHxWxC (C=4) Reshape + Permute | ||
// | ||
//32xHxW -> Reshape -> 8x4xHxW -> Permute(0, 2, 3, 1) -> 8xHxWx4 // hay capas y funciones | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* EDDL Library - European Distributed Deep Learning Library. | ||
* Version: 0.7 | ||
* copyright (c) 2020, Universidad Politécnica de Valencia (UPV), PRHLT Research Centre | ||
* Date: April 2020 | ||
* Author: PRHLT Research Centre, UPV, ([email protected]), ([email protected]) | ||
* All rights reserved | ||
*/ | ||
|
||
#include "eddl/profiling.h" | ||
|
||
#ifdef EDDL_WINDOWS | ||
int gettimeofday(struct timeval* tp, struct timezone* tzp) | ||
{ | ||
namespace sc = std::chrono; | ||
sc::system_clock::duration d = sc::system_clock::now().time_since_epoch(); | ||
sc::seconds s = sc::duration_cast<sc::seconds>(d); | ||
tp->tv_sec = s.count(); | ||
tp->tv_usec = sc::duration_cast<sc::microseconds>(d - s).count(); | ||
|
||
return 0; | ||
} | ||
#endif |