From 0d51264d2a0a09bb7bd53d161b6809dc666afd03 Mon Sep 17 00:00:00 2001 From: Sepcnt <30561671+sepcnt@users.noreply.github.com> Date: Sun, 19 May 2024 17:17:21 +0000 Subject: [PATCH] Polyfill for thread.h and fix disk issue of Linux CI --- .github/workflows/build.yml | 2 ++ src/hvm.c | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b1778b18..d40d1f25 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,6 +26,8 @@ jobs: id: cuda-toolkit with: cuda: '12.4.1' + method: 'network' + sub-packages: '["nvcc"]' if: matrix.os != 'macOS-latest' - name: Clippy Check diff --git a/src/hvm.c b/src/hvm.c index c857359f..897fbcb4 100644 --- a/src/hvm.c +++ b/src/hvm.c @@ -1,10 +1,16 @@ #include #include -#include #ifdef _WIN32 #include +#include #else #include +typedef pthread_t thrd_t; +typedef void* thrd_start_t; +#define thrd_create(a, b, c) pthread_create(a, NULL, b, c) +#define thrd_join(a, b) pthread_join(a, b) +#define thrd_yield() sched_yield() +#define thrd_sleep(a, b) nanosleep(a, b) #endif #include #include @@ -662,7 +668,7 @@ static inline void net_init(Net* net) { // is that needed? atomic_store(&net->itrs, 0); atomic_store(&net->idle, 0); - + // allocates global buffers net->node_buf = malloc(G_NODE_LEN * sizeof(APair)); net->vars_buf = malloc(G_VARS_LEN * sizeof(APort));