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
_defaults: | |
max_duration: 600 | |
voir: | |
options: | |
stop: 60 | |
interval: "1s" | |
_torchvision: | |
inherits: _defaults | |
definition: ../benchmarks/torchvision |
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
import multiprocessing | |
from multiprocessing.managers import SharedMemoryManager | |
import time | |
import json | |
SHM_INDEX_IN = -1 | |
SHM_INDEX_OUT = -2 | |
SHM_ON = -3 | |
SHM_SIZE = -4 | |
SHM_MAX = 4 |
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
SHR_ON = 1 | |
def _worker(in_queue, out_queue, shared_state, cls, cls_args): | |
shared_state[SHR_ON] = 1 | |
with cls(*cls_args, out_queue=out_queue) as handler: | |
while shared_state[SHR_ON]: | |
try: | |
args, kwargs = in_queue.get(True, timeout=0.01) | |
handler(args, kwargs) |
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
#include <cassert> | |
#include <cmath> | |
#include <cstdint> | |
#include <functional> | |
#include <iostream> | |
#include <vector> | |
template <typename V> using Array = std::vector<V>; |
OlderNewer