You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the lara.code.Timer API, the timers inserted into the code are those from the current OS, i.e., Windows timers if Clava is running on Windows, and UNIX timers if it is running on Linux or other *nix.
However, I've run into the use case where I am working with Linux-specific input C code, but since I am running Clava on Windows it inserts Windows timers into the Linux application.
Therefore, I suggest an additional (optional) argument to the Timer constructor, specifying which kinds of timers we want to use, like so:
const timer = new Timer("MICROSECONDS", this.filename);
becomes
const timer = new Timer("MICROSECONDS", this.filename, "UNIX");
As an added note, I don't think this problem happens with C++, as it uses STL timers in that scenario. This is a C-only issue.
The text was updated successfully, but these errors were encountered:
The Timer API, as well as other APIs that generate code that depends on the platform, use the API Platforms to check on which platform they are currently executing.
The API contains setters (e.g. Platforms.setLinux()) which can be used to set a particular platform. That is the preferred way to generate code for a target platform that is not the same as the host platform.
When using the
lara.code.Timer
API, the timers inserted into the code are those from the current OS, i.e., Windows timers if Clava is running on Windows, and UNIX timers if it is running on Linux or other *nix.However, I've run into the use case where I am working with Linux-specific input C code, but since I am running Clava on Windows it inserts Windows timers into the Linux application.
Therefore, I suggest an additional (optional) argument to the Timer constructor, specifying which kinds of timers we want to use, like so:
const timer = new Timer("MICROSECONDS", this.filename);
becomes
const timer = new Timer("MICROSECONDS", this.filename, "UNIX");
As an added note, I don't think this problem happens with C++, as it uses STL timers in that scenario. This is a C-only issue.
The text was updated successfully, but these errors were encountered: