Skip to content

Instantly share code, notes, and snippets.

View Delaunay's full-sized avatar

Setepenre Delaunay

  • Montréal
View GitHub Profile
@Delaunay
Delaunay / PAICE.yaml
Created February 26, 2024 17:02
PAICE.yaml
_defaults:
max_duration: 600
voir:
options:
stop: 60
interval: "1s"
_torchvision:
inherits: _defaults
definition: ../benchmarks/torchvision
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
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)
#include <cassert>
#include <cmath>
#include <cstdint>
#include <functional>
#include <iostream>
#include <vector>
template <typename V> using Array = std::vector<V>;