@@ -72,9 +72,9 @@ class WorkspaceManager
72
72
//
73
73
74
74
// Default overprov factor for large GPU problems, testing has shown 1.25 is optimal
75
- // Some linkers were having trouble with the code below, so just define it
75
+ // Some linkers were having trouble with the code below, so use a function
76
76
// static inline constexpr double GPU_DEFAULT_OVERPROVISION_FACTOR = 1.25;
77
- # define WSM_GPU_DEFAULT_OVERPROVISION_FACTOR 1.25
77
+ static constexpr double GPU_DEFAULT_OVERPROVISION_FACTOR () { return 1.25 ; }
78
78
79
79
//
80
80
// ------- public API ---------
@@ -89,7 +89,7 @@ class WorkspaceManager
89
89
// policy: The team policy for Kokkos kernels using this WorkspaceManager
90
90
// overprov_factor: How many workspace slots to overprovision (only applies to GPU for large problems)
91
91
WorkspaceManager (int size, int max_used, TeamPolicy policy,
92
- const double & overprov_factor=WSM_GPU_DEFAULT_OVERPROVISION_FACTOR );
92
+ const double & overprov_factor=GPU_DEFAULT_OVERPROVISION_FACTOR() );
93
93
94
94
// Constructor, call from host
95
95
// Same as above, but here the user initializes the data.
@@ -99,14 +99,14 @@ class WorkspaceManager
99
99
// data is available, for which the get_total_slots_to_be_used()
100
100
// function can be helpful.
101
101
WorkspaceManager (T* data, int size, int max_used, TeamPolicy policy,
102
- const double & overprov_factor=WSM_GPU_DEFAULT_OVERPROVISION_FACTOR );
102
+ const double & overprov_factor=GPU_DEFAULT_OVERPROVISION_FACTOR() );
103
103
104
104
// Helper functions which return the number of bytes that will be reserved for a given
105
105
// set of constructor inputs. Note, this does not actually create an instance of the WSM,
106
106
// but is useful for when memory needs to be reserved in a different scope than the
107
107
// WSM is created.
108
108
static int get_total_bytes_needed (int size, int max_used, TeamPolicy policy,
109
- const double & overprov_factor=WSM_GPU_DEFAULT_OVERPROVISION_FACTOR );
109
+ const double & overprov_factor=GPU_DEFAULT_OVERPROVISION_FACTOR() );
110
110
111
111
// call from host.
112
112
//
@@ -118,14 +118,14 @@ class WorkspaceManager
118
118
//
119
119
// Setup routine for the WSM if the user used the empty constructor
120
120
void setup (int size, int max_used, TeamPolicy policy,
121
- const double & overprov_factor=WSM_GPU_DEFAULT_OVERPROVISION_FACTOR );
121
+ const double & overprov_factor=GPU_DEFAULT_OVERPROVISION_FACTOR() );
122
122
123
123
// call from host.
124
124
//
125
125
// Setup routine for the WSM if the user used the empty constructor.
126
126
// Same as above, but here the user initializes the data.
127
127
void setup (T* data, int size, int max_used, TeamPolicy policy,
128
- const double & overprov_factor=WSM_GPU_DEFAULT_OVERPROVISION_FACTOR );
128
+ const double & overprov_factor=GPU_DEFAULT_OVERPROVISION_FACTOR() );
129
129
130
130
// call from host.
131
131
//
0 commit comments