SkePU  1.2
 All Classes Namespaces Files Functions Variables Enumerations Friends Macros Groups Pages
globals.h
Go to the documentation of this file.
1 #ifndef _GLOBAL_H_
2 #define _GLOBAL_H_
3 
8 #include <string>
9 #include <iostream>
10 
11 namespace skepu
12 {
13 
14 /* timing is in µs per byte (i.e. slowness, inverse of bandwidth) */
15 typedef struct
16 {
17  int cpu_id;
18  double timing_htd;
19  double latency_htd;
20  double timing_dth;
21  double latency_dth;
22  double timing_dtd;
23  double latency_dtd;
24 } DevTimingStruct;
25 
26 #define MAX_EXEC_PLANS 10
27 
28 #define MAX_PARAMS 10
29 
30 #ifndef MAX_DEPTH
31 #define MAX_DEPTH 10
32 #endif
33 
34 #define OVERSAMPLE false
35 
36 #define MAX_PARAMS_MAP 3
37 
42 #ifndef MAX_GPU_DEVICES
43 #define MAX_GPU_DEVICES 4
44 #endif
45 
46 // based on CUDA programming guide v7.0
47 #define MAX_POSSIBLE_CUDA_STREAMS_PER_GPU 32
48 
49 #ifndef SKEPU_NUMGPU
50 #define SKEPU_NUMGPU 1
51 #elif defined(SKEPU_CUDA) // Only when CUDA is enabled and multi-GPU is possible
52 // #define USE_PINNED_MEMORY
53 #endif
54 
55 // used when checking shared memory and overlap exceeding that in mapoverlap_cu.inl
56 #define SHMEM_SAFITY_BUFFER 30
57 
58 // use it to specify threshold when reduction operation should shift to CPU instead of continuing it on GPU, used in 2D reduction specially.
59 #define REDUCE_GPU_THRESHOLD 50
60 
61 // OpenCL additional code that can be supplied in a file. useful when using a custom type with skeletons
62 #define OPENCL_SOURCE_FILE_NAME "opencl_datatype_src.cl"
63 
64 
65 #ifndef SKEPU_CUDA_DEV_ID
66 #define SKEPU_CUDA_DEV_ID 0
67 #endif
68 
69 
70 }
71 
72 
73 #include "src/debug.h"
74 
75 #ifdef SKEPU_CUDA
76 #include "src/skepu_cuda_helpers.h"
77 #include "src/device_allocations_cu.h"
78 #endif
79 
80 #ifdef SKEPU_OPENCL
82 #endif
83 
84 #include "src/helper_methods.h"
85 
86 
87 
88 
89 
90 #endif
91 
Contains few helper methods that are used globally by different classes.
Defines a few macros that includes macros to output text when debugging. The macros use std::cerr...
Contains the definitions of some helper functions related to CUDA backend.
Contains the definitions of some helper functions related to OpenCL backend.