-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathgufunc_scheduler.h
53 lines (46 loc) · 1.32 KB
/
gufunc_scheduler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
* Copyright (c) 2017 Intel Corporation
* SPDX-License-Identifier: BSD-2-Clause
*/
#ifndef GUFUNC_SCHEDULER
#define GUFUNC_SCHEDULER
/* define int64_t and uint64_t for Visual Studio, where stdint only available > VS2008 */
#ifdef _MSC_VER
#define int64_t signed __int64
#define uint64_t unsigned __int64
#else
#include <stdint.h>
#endif
#ifndef __SIZEOF_POINTER__
/* MSVC doesn't define __SIZEOF_POINTER__ */
#if defined(_WIN64)
#define intp int64_t
#define uintp uint64_t
#elif defined(_WIN32)
#define intp int
#define uintp unsigned
#else
#error "cannot determine size of intp"
#endif
#elif __SIZEOF_POINTER__ == 8
#define intp int64_t
#define uintp uint64_t
#else
#define intp int
#define uintp unsigned
#endif
#ifdef __cplusplus
extern "C"
{
#endif
void do_scheduling_signed(uintp num_dim, intp *starts, intp *ends, uintp num_threads, intp *sched, intp debug);
void do_scheduling_unsigned(uintp num_dim, intp *starts, intp *ends, uintp num_threads, uintp *sched, intp debug);
uintp set_parallel_chunksize(uintp);
uintp get_parallel_chunksize(void);
uintp get_sched_size(uintp num_threads, uintp num_dim, intp *starts, intp *ends);
intp * allocate_sched(uintp sched_size);
void deallocate_sched(intp * sched);
#ifdef __cplusplus
}
#endif
#endif