IOR
iordef.h
Go to the documentation of this file.
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  */
4 /******************************************************************************\
5 * *
6 * Copyright (c) 2003, The Regents of the University of California *
7 * See the file COPYRIGHT for a complete copyright notice and license. *
8 * *
9 \******************************************************************************/
10 
11 #ifndef _IORDEF_H
12 #define _IORDEF_H
13 
14 #ifdef HAVE_CONFIG_H
15 # include "config.h"
16 #endif
17 
18 #include <stdio.h>
19 #include <stdlib.h>
20 #include <string.h>
21 
22 typedef enum {
23  DATA_TIMESTAMP, /* Will not include any offset, hence each buffer will be the same */
25  DATA_INCOMPRESSIBLE, /* Will include the offset as well */
26  DATA_RANDOM /* fully scrambled blocks */
28 
29 typedef enum{
31  IOR_MEMORY_TYPE_GPU_MANAGED_CHECK_CPU = 1, /* Verifications are run on CPU */
32  IOR_MEMORY_TYPE_GPU_MANAGED_CHECK_GPU = 2, /* Verifications are run on GPU */
35 
36 #ifdef _WIN32
37 # define _CRT_SECURE_NO_WARNINGS
38 # define _CRT_RAND_S
39 # pragma warning(4 : 4996) /* Don't complain about POSIX names */
40 # pragma warning(4 : 4267) /* '=' : conversion from 'size_t' to 'int' */
41 # pragma warning(4 : 4244) /* 'function' : conversion from 'IOR_offset_t' to 'int' */
42 
43 # include <Windows.h>
44 # include <io.h>
45 # include <direct.h>
46 
47 # define F_OK 00
48 # define W_OK 02
49 # define R_OK 04
50 # define X_OK 04
51 
52 # define lseek _lseeki64
53 # define fsync _commit
54 # define mkdir(dir, mode) _mkdir(dir)
55 # define strcasecmp _stricmp
56 # define strncasecmp _strnicmp
57 # define srandom srand
58 # define random() (rand() * (RAND_MAX+1) + rand()) /* Note: only 30 bits */
59 # define sleep(X) Sleep((X)*1000)
60 # define sysconf(X) 4096
61 #else
62 # include <sys/param.h> /* MAXPATHLEN */
63 # include <unistd.h>
64 # include <limits.h>
65 #endif
66 
67 /*************************** D E F I N I T I O N S ****************************/
68 
73 };
74 
75 #ifndef FALSE
76 # define FALSE 0
77 #endif /* not FALSE */
78 
79 #ifndef TRUE
80 # define TRUE 1
81 #endif /* not TRUE */
82 
83 #ifndef NULL
84 # define NULL ((void *)0)
85 #endif /* not NULL */
86 
87 #define KILOBYTE 1000
88 #define MEGABYTE 1000000
89 #define GIGABYTE 1000000000
90 
91 #define KIBIBYTE (1 << 10)
92 #define MEBIBYTE (1 << 20)
93 #define GIBIBYTE (1 << 30)
94 
95 /* for displaying MiB or MB */
96 #define BASE_TWO 0
97 #define BASE_TEN 1
98 
99 /* any write/read access in code */
100 #define WRITE 0
101 #define WRITECHECK 1
102 #define READ 2
103 #define READCHECK 3
104 
105 /* verbosity settings */
106 #define VERBOSE_0 0
107 #define VERBOSE_1 1
108 #define VERBOSE_2 2
109 #define VERBOSE_3 3
110 #define VERBOSE_4 4
111 #define VERBOSE_5 5
112 
113 #define MAX_STR 1024 /* max string length */
114 #define MAX_HINTS 16 /* max number of hints */
115 #define MAX_RETRY 10000 /* max retries for POSIX xfer */
116 #ifndef PATH_MAX
117 #define PATH_MAX 4096
118 #endif
119 
120 #define DELIMITERS " \t\r\n=" /* ReadScript() */
121 #define FILENAME_DELIMITER '@' /* ParseFileName() */
122 
123 typedef long long int IOR_offset_t;
124 typedef long long int IOR_size_t;
125 
126 #define IOR_format "%016llx"
127 
128 /******************************************************************************/
129 /*
130  * System info for Windows.
131  */
132 
133 #ifdef _WIN32
134 
135 struct utsname {
136  char sysname [16];
137  char nodename[257];
138  char release [16];
139  char version [16];
140  char machine [16];
141 };
142 
143 extern int uname(struct utsname *name);
144 
145 #endif /* _WIN32 */
146 
147 #endif /* not _IORDEF_H */
OutputFormat_t
Definition: iordef.h:69
long long int IOR_size_t
Definition: iordef.h:124
ior_dataPacketType_e
Definition: iordef.h:22
ior_memory_flags
Definition: iordef.h:29
long long int IOR_offset_t
Definition: iordef.h:123