Skip to content

Commit

Permalink
Try to fix compilation error
Browse files Browse the repository at this point in the history
  • Loading branch information
saharNooby committed Sep 18, 2023
1 parent 69306e6 commit d36aa94
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 0 additions & 8 deletions rwkv.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
#include "rwkv.h"

// Fix build on Linux.
// https://stackoverflow.com/questions/8518264/where-is-the-declaration-of-cpu-alloc
#if defined(__linux__)
#define _GNU_SOURCE
#include <sched.h>
#endif

#include "ggml.h"
#include "ggml-alloc.h"

Expand Down
12 changes: 10 additions & 2 deletions tests/test_ggml_basics.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
// Tests that ggml basics work.

// Fix build on Linux.
// https://stackoverflow.com/questions/8518264/where-is-the-declaration-of-cpu-alloc
#if defined(__linux__)
#define _GNU_SOURCE
#include <sched.h>
#endif

#include <ggml.h>

#include <stdio.h>
Expand All @@ -23,7 +31,7 @@
}

// Tests simple computation in a single context.
static void test_computation() {
static void test_computation(void) {
struct ggml_init_params params = {
.mem_size = 16 * 1024,
.mem_buffer = NULL,
Expand Down Expand Up @@ -62,7 +70,7 @@ static void test_computation() {

// Tests that operations on tensors from different contexts work.
// RWKV model loading code depends on this behavior.
static void test_tensors_from_different_contexts() {
static void test_tensors_from_different_contexts(void) {
struct ggml_init_params params = {
.mem_size = 16 * 1024,
.mem_buffer = NULL,
Expand Down

0 comments on commit d36aa94

Please sign in to comment.